Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): Allow null associations on non-required fields. #2440

Merged
merged 3 commits into from
May 10, 2023

Conversation

mattcreaser
Copy link
Member

@mattcreaser mattcreaser commented May 10, 2023

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:
#2431

Description of changes:
Don't throw an exception if an association field is null when creating a mutation.

This is because it is valid for the field to be null if it's not required. Codegen does not mark such fields as required in the generated models. If it is required then attempting to submit the mutation with a null value will result in an error response.

How did you test these changes?
Checked that the schema provided in the original issue could now create a Note class without a customer association.

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mattcreaser mattcreaser requested a review from a team as a code owner May 10, 2023 14:09
@eeatonaws eeatonaws merged commit c9c9c4c into main May 10, 2023
@eeatonaws eeatonaws deleted the mattcreaser/null-association branch May 10, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants