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

Jun2018 spec: Make sure there is no ambiguity with null values (facebook/graphql/#418) #166

Open
jlouis opened this issue Jun 21, 2018 · 1 comment

Comments

@jlouis
Copy link
Owner

jlouis commented Jun 21, 2018

There is currently ambiguity and inconsistency in how null values are coerced and resolved as part of variable values, default values, and argument values. This inconsistency and ambiguity can allow for null values to appear at non-null arguments, which might result in unforseen null-pointer-errorrs.

Fix this coercion problem by handling each of the cases according to the issue.

The key new feature is that if you have a non-null input, with a default, then this is allowed and the field isn't "required" per se anymore. Another key feature is that if you have a $var : T for some (nullable) type T, then this can be used in a non-null context proviso that context supplies a default value. In short, default value handling is now more lenient.

@jlouis
Copy link
Owner Author

jlouis commented Jun 24, 2018

While handling this case, also handle the issue 388 in the GraphQL specification. This issue handles how input coercion of more complex types are supposed to work in the specification. It requires handling while one is handling this case as well as they are intermixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant