Skip to content
New issue

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

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

Already on GitHub? # to your account

Add nullvalue #696

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add nullvalue #696

wants to merge 4 commits into from

Conversation

xxlv
Copy link

@xxlv xxlv commented Jul 3, 2024

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:

  1. When the input is required, null is not an acceptable value.
  2. 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.

@coveralls
Copy link

Coverage Status

coverage: 92.056% (+0.008%) from 92.048%
when pulling d0c8027 on xxlv:add-nullvalue
into f2b39ca on graphql-go:master.

@coveralls
Copy link

Coverage Status

coverage: 92.056% (+0.008%) from 92.048%
when pulling c5ca6e6 on xxlv:add-nullvalue
into f2b39ca on graphql-go:master.

@coveralls
Copy link

Coverage Status

coverage: 92.072% (+0.02%) from 92.048%
when pulling 72d7caa on xxlv:add-nullvalue
into f2b39ca on graphql-go:master.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants