-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Allow for partial updates by ignoring missing input fields #7948
Comments
I created a PR to illustrate the required changes. I also added a simple test for the new behavior but can't get it to run because it's missing some instances of the tested components. See #7949 |
Thats what |
But |
@maurice-freitag |
Can this be closed or do you still have concerns, or is there something missing? |
Product
Hot Chocolate
Is your feature request related to a problem?
I have defined a mutation to update an object. _id is a required parameter, everything else is optional. When I send one such query and only set a few of these properties, the context is still populated with the missing fields as soon as our middleware is hit, all of them having null values. We would like to support partial updates, so an input object only containing only the fields the user actually set would be preferred. The current implementation makes it impossible to determine if the user wanted to set a value to null explicitly or chose to not update the missing fields at all.
I tracked the issue down to the
InputParser
, the missing values seem to be populated here.The solution you'd like
Allow configuring the input parser to support the desired behavior.
The text was updated successfully, but these errors were encountered: