-
Notifications
You must be signed in to change notification settings - Fork 173
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
Partial update in resolver #141
Comments
I read the article, but this feature relies on the Javascript feature that a variable can be |
I am late to the party but it is possible to implement an Undefined class, inspired from Optional to deal with this use case (code improved from @KrifaYounes idea):
The schema:
The input:
In the resolver use:
This approach removes the needs to perform several contains operations and to have the literal key hard-coded. |
@AllirionX if(input.getTitle().isDefined()) {
book.setTitle(input.getTitle().getValue();
} |
Indeed it should be! I updated the code snippet. |
Why not use |
it's possible to do partial update in the resolver ?
i have a input to update with only field specified by user like this blog
thanks
https://medium.com/workflowgen/graphql-mutations-partial-updates-implementation-bff586bda989
The text was updated successfully, but these errors were encountered: