Add support for partial updates
Adds support for binding to java.util.Optional parameters. Binding to Optional parameters allows implementing partial updates. With a partial update the mutate call can update only some of the Optional fields without needing to repeat all the existing values of an object.
The mapping from an optional field in GraphQL schema that binds to java.util.Optional is the following:
- value given to the field in GraphQL call is mapped into
java.util.Optionalof the underlying type - null given to the field in GraphQL call is mapped into
Optional.emptyto signal the removal of a possibly existing value of the field - field not included in the GraphQL call is mapped into null to signal
undefinedso any possibly existing value(s) should not be modified
Thank you for the PR @anttip,
After an initial look, this seems like a good idea, things are a bit busy on our end but we'll try to review that PR at some point in May (or earlier if we can).
Sorry for the delay, we'll try to review it by the end of June.
Thanks for the update! Looking forward to the review. Meanwhile I can report that we have been using it without issues from our fork since creation. Hope it makes it to the project and is useful for others as well.
@Fgerthoffert Any updates on this?
Apologies for the repeated delays, the past few months have been quite busy on our end. If everything goes as expected, we should review it within the next 2–3 weeks.
Thank you for the review and suggestions @dgriffon!
Thank you so much for your contribution! 🚀 Your work on adding support for partial updates is greatly appreciated. This enhancement will be valuable for the project and its users. Thank you for your time and effort in improving the codebase! 🙏