I have noticed that the go-graphql project does not handle null values for input correctly. According to the GraphQL specification GraphQL Spec, there are two scenarios for handling null values in inputs:
When the input is required, null is not an acceptable value.
When the input parameter is optional, the null literal is acceptable.
For example, the following is not allowed:
Def:
NonNullField(arg: String!): String
Use:
{
NonNullField(arg: null) // not allowed
}
After completing my changes, I found that @krasish has done similar work in pull request #683 , which has not yet been merged.
Please review this implementation, thank you very much.
coverage: 92.056% (+0.008%) from 92.048%
when pulling d0c80278c4b8b6cb1ff63b6b3c5f67e67af5834b on xxlv:add-nullvalue
into f2b39caf7c92cab3f3f92726b55f59c74f54cfbc on graphql-go:master.
coverage: 92.056% (+0.008%) from 92.048%
when pulling c5ca6e6f198f083125b0d51c117bb2dd0111b050 on xxlv:add-nullvalue
into f2b39caf7c92cab3f3f92726b55f59c74f54cfbc on graphql-go:master.
coverage: 92.072% (+0.02%) from 92.048%
when pulling 72d7caaa6197c0348c9455e4d75c8b94cb0ec198 on xxlv:add-nullvalue
into f2b39caf7c92cab3f3f92726b55f59c74f54cfbc on graphql-go:master.
Description:
I have noticed that the go-graphql project does not handle null values for input correctly. According to the GraphQL specification GraphQL Spec, there are two scenarios for handling null values in inputs:
For example, the following is not allowed:
Def:
Use:
After completing my changes, I found that @krasish has done similar work in pull request #683 , which has not yet been merged.
Please review this implementation, thank you very much.