Skip to content

Conversation

anttip
Copy link
Contributor

@anttip anttip commented Mar 17, 2025

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:

  1. value given to the field in GraphQL call is mapped into java.util.Optional of the underlying type
  2. null given to the field in GraphQL call is mapped into Optional.empty to signal the removal of a possibly existing value of the field
  3. field not included in the GraphQL call is mapped into null to signal undefined so any possibly existing value(s) should not be modified

@Fgerthoffert
Copy link
Collaborator

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).

@Fgerthoffert
Copy link
Collaborator

Sorry for the delay, we'll try to review it by the end of June.

@anttip
Copy link
Contributor Author

anttip commented Jun 5, 2025

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.

@anttip
Copy link
Contributor Author

anttip commented Aug 4, 2025

@Fgerthoffert Any updates on this?

@Fgerthoffert
Copy link
Collaborator

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.

Copy link
Contributor

@dgriffon dgriffon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution, globally everything is good, please fix the few suggestions, we'll be able to merge afterwards

anttip and others added 2 commits August 25, 2025 16:16
Co-authored-by: David Griffon <dgriffon@jahia.com>
Co-authored-by: David Griffon <dgriffon@jahia.com>
@anttip
Copy link
Contributor Author

anttip commented Aug 25, 2025

Thank you for the review and suggestions @dgriffon!

@anttip anttip requested a review from dgriffon August 27, 2025 06:48
@jkevan jkevan merged commit 7a83e7b into Enigmatis:master Aug 27, 2025
3 checks passed
@jkevan
Copy link
Collaborator

jkevan commented Aug 27, 2025

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! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants