-
Notifications
You must be signed in to change notification settings - Fork 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
returning null for a custom scalar's serialize #3532
Comments
Hi @IvanGoncharov, Since this issue is unresponsive for a long time. I noticed that you are a recent committer for this project. May I ask what you think about this issue? Due to this problem. I cannot returns a null value manually for a resolver. And the void scalar like this doesn't work. I really hope this can be fixed if it's not intentional. |
@cnwangjie Spec says:
"internal method" is So it's intentional. |
Hey @IvanGoncharov, what's the recommended workaround for this? |
@Yifeng-Sigma did you find a workaround for this? |
No, probably I shouldn't use scalar if it's nullable. |
I just ran into this in production after upgrading to We absolutely want our custom Scalar to decide whether to return |
This is a bit of an unexpected and very annoying behavior, even if it's intentional, as it means you can't really use custom Scalars on nullable fields. The best workaround seems to be to return an empty string, but it is of my opinion that such behavior should be reavaliated. |
There is an old issue #1057 for that.
It has been fixed in #1104. But It does not work for now (v16.3.0).
graphql-js/src/execution/execute.ts
Lines 783 to 795 in b38429f
@leebyron Is it a mistake or as expected?
The text was updated successfully, but these errors were encountered: