-
Notifications
You must be signed in to change notification settings - Fork 6
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: allow nullable input objects and arrays #67
Conversation
Thanks for submitting - I'll take a look tonight :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - just one comment about the object side of things!
@peterc1731 Thanks for addressing this fix! |
@peterc1731 are you still interested in addressing @jonnydgreen comment? |
Apologies, completely forgot to get back to this one! I will take a look today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@mcollina thinking a semver patch release for this one? |
yes |
Fixes #57
When inferring types from the schema, the library does not consider nullability for objects or arrays. The test that validates nullable input types ("should support nullable input type arguments") was only validating string type inputs, when adding validation for a few more input types as I've done in this PR, that test fails.
I've applied a fix for the issue as well as updating the tests, I'm not sure if the approach is the best one, but it works and its a simple change with low impact on the rest of the behaviour.