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

Correctly validate optional list in inputs #1133

Merged
merged 5 commits into from
Nov 10, 2021
Merged

Conversation

darl
Copy link
Contributor

@darl darl commented Nov 10, 2021

Didn't read graphql spec, but this seems like correct behaviour.

@ghostdogpr
Copy link
Owner

Your fix is correct in the case of a List but I think we should go even further.

In the spec (http://spec.graphql.org/June2018/#sec-Scalars): For all types below, with the exception of Non‐Null, if the explicit value null is provided, then the result of input coercion is null.. So I think other types need the same treatment. @frekw right?

Copy link
Collaborator

@frekw frekw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good. But I think we should do the same for INPUT_OBJECT and ENUM as well?

@frekw
Copy link
Collaborator

frekw commented Nov 10, 2021

Ah you beat me to it @ghostdogpr :)

@darl

This comment has been minimized.

@darl
Copy link
Contributor Author

darl commented Nov 10, 2021

Nevermind. I got it. Will fix soon

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@ghostdogpr ghostdogpr merged commit 7cbe359 into ghostdogpr:master Nov 10, 2021
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