-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot set ID of graphql.scalar to null #3432
Comments
Same problem. I have a mutation that returns a Payload which contains nullable fields. One of them is of type ID |
On the original problem we have the error message
Looking at the code it has
So in order to get This means that the This is the Java
So somehow this ID class is returning null when The Scalar ID will only be called on non null obejcts. If the id field was truly null at the data fetcher level, then the engine itself will produce a null value and will not call the ID scalar code to serlialise. So in summary
I think to fix it - this null returning ID value should not be used and rather a true null should be returned |
@bbakerman thanks for your quick and great answer. My app is in Kotlin. Here is my GraphQL payload type:
The "ID" type is this one:
So, in this case, do you mean that this issue is more a "graphql-kotlin" lib issue (that should send a null rather than a somehow ID(null)) than a "graphql-java" issue? |
Describe the bug
I'm trying to response to a request with ID nullable. I'm in kotlin.
When i set my ID to null, i've got this error :
The text was updated successfully, but these errors were encountered: