-
Notifications
You must be signed in to change notification settings - Fork 152
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 values in body are not passed through to graphql backend #114
Comments
Thanks for reporting. We've got people who wanted to have the exact opposite behaviour. I guess we should make this configurable. Do you think this need to have granular configuration or could it be just at the datasource level? E.g. switch it on or off via boolean config param for the whole origin. |
Hi Jens, thanks for the quick response. In GraphQL, one can have different semantics for non-inclusion vs inclusion as null. Therefore I believe the default should be to pass nulls through. Otherwise an intentional feature of GraphQL backends is not available through Wundergraph. I see this filtering null values as an additional filtering feature, rather than the way the system should behave by default. If someone wishes to have this filtering nulls behaviour, and they want it in the Go codebase for performance reasons, rather than a hook, I can see the value in that. I imagine enabling the filter for the entire datasource would be sufficient. I would do it wherever it's easiest and most performant. |
Sounds reasonable to me, although the reason is not performance. In some cases, you don't want to send nulls because the server handles them differently than empty fields, e.g. in a patch. |
Yes, this is the reason I meant. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @spetrunin nice find :-) |
The Wundergraph operation looks like this:
I have the semantics that we can clear a value by sending an update with a null value.
This is different to sending an update when some values are not set, which means don't change the values not included in the call.
For example, in the below call, I want to clear the existing "name" attribute on the object.
You can see by the above, the Wundergraph server removes the "name" attribute, as it is null. If I set it to something else, it works ok.
The desired behaviour is for the wundergraph server to pass through null-valued arguments.
The text was updated successfully, but these errors were encountered: