-
Notifications
You must be signed in to change notification settings - Fork 60
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
Missing variable value for nullable field argument #181
Comments
@osener Thanks for reporting this. I've re-read the spec a bit, and it seems unclear to me what the right behavior is for nullable field arguments and missing variable vales. I'll need to investigate a bit further. If you have any insights, I'd be happy to hear. While looking over the variable handling code, there appears to be some other issues around default values, which I'll look into also.. |
Thank you @andreas! I'll try to understand the correct (or common) approach to this better and report back if I have any additional insight. Right now I have a working client-side workaround. |
Based on this test case from |
A quick note: Nullable arguments are currently represented via an |
(Originally posted by @osener in #179 (comment))
@andreas It's more of a question I guess, I don't know what behavior is correct and I'm curious whether a possible OGS solution to this issue would be relevant to my issue.
If I call this query with
{ "first": 10 }
I get this error back:while
{ "first": 10, "after": null }
works.In fact, this was the way
graphql_ppx
worked. It would force me to declare every variable and construct something like{ "first": Some(10), "after": None }
, and it would encodeNone
withnull
.After switching to
graphql_ppx_re
because of newer BuckleScript support I noticed mynull
(None
) values started to get dropped, which ocaml-graphql-server did not like.During the subsequent discussion in the issue the author said he made this change to work around an issue with Sangria, but also that this change is compliant with the spec.
Now I realize that my issue is about variables passed to the query, which is not this issue is about. But I'm still curious about your opinion on this, is this something I should attempt to solve on the client side, or at ocaml-graphql-server side?
The text was updated successfully, but these errors were encountered: