-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
null parameters cause crashes #346
Comments
I don't think that's quite true, the spec distinguishes between null and undefined (see from your example, History should be called as The |
Thanks! Learned something about gql today :) |
I was actually looking at the code you use around marshalling / unmarshalling -- why choose I think also the number of pointer types that are generated is a bit excessive for most scenarios where |
GraphQL doesn't specify the transport or encoding at all, the defacto standard is http + json, but it can be anything. gqlgen is written with this in mind, even though it targets the common use case out of the box.
If you write your own models the binding logic should let you remove most of them. There are some upcoming changes to make generated models more customizable, maybe a |
Ah, I see so because the marshallers consume types they can't implement the standard encoding interfaces, which all consume bytes |
I'm dealing with a swath of issues around
gqlgen
's implementation of defaults and nullable types. They seem bizarre, so I thought the issue was on my end, but i have been unable to find a sold root cause within my minimal code.Expected Behaviour
When a null is passed as a parameter, it should be replaced with its default parameter.
Actual Behavior
Generated code attempts to parse
<nil>
, and then rejects the request.Minimal graphql.schema and models to reproduce
The text was updated successfully, but these errors were encountered: