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

Fix Issue With Argument Pointer Type #359

Merged
merged 5 commits into from
Oct 2, 2018
Merged

Conversation

mathewbyrne
Copy link
Contributor

@mathewbyrne mathewbyrne commented Oct 1, 2018

In #346 there was an issue revealed where a non-nullable argument with a default value was not passing an input null through to the resolver, and instead was giving an error.

The reason for this is that if an argument has a default and is a pointer (nullable), the pointer is stripped. This cha This change removes this behaviour and keeps type a pointer. If an argument is nullable, then null is always a valid value.

Fixes #346

@mathewbyrne
Copy link
Contributor Author

@vektah you think this is worth getting on master or BC enough for next?

@vektah
Copy link
Collaborator

vektah commented Oct 2, 2018

@vektah you think this is worth getting on master or BC enough for next?

Maybe lets ship to master and try and get a v0.6.0 (excluding next) out today so we don't have a bunch of untagged stuff out for too long?

Mathew Byrne added 5 commits October 2, 2018 12:00
This fails if a client still sends a null value.  If an arg is nullable
but has a default, then null is still a valid value to send through.
@mathewbyrne mathewbyrne merged commit 1cae19b into master Oct 2, 2018
@vektah vektah deleted the fix-null-arg-error branch October 2, 2018 03:11
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

null parameters cause crashes
2 participants