You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default input arguments in GraphQL are nullable and optional, see Nullable vs Optional, which means an argument can be set to null, or not provided at all. The distinction enables partial updates in mutations where the underlying data storage can also be either set to null or not changed at all.
As described in #140 and #228, when binding an argument via @Argument, there is no way to make such a distinction. You can get a null or an empty Optional for the resulting value, but no way to check if the argument was omitted or not.
We can provide ArgumentValue as a simple container for the underlying value along with a flag for whether it was omitted or not. This could be used as an alternative to @Argument on controller method parameters, or nested within the structure of an @Argument object.
The text was updated successfully, but these errors were encountered:
rstoyanchev
changed the title
Support checking if a GraphQL argument was omitted
Support checks if GraphQL argument was set to null or omitted entirely
Nov 9, 2022
By default input arguments in GraphQL are nullable and optional, see Nullable vs Optional, which means an argument can be set to
null
, or not provided at all. The distinction enables partial updates in mutations where the underlying data storage can also be either set tonull
or not changed at all.As described in #140 and #228, when binding an argument via
@Argument
, there is no way to make such a distinction. You can get anull
or an emptyOptional
for the resulting value, but no way to check if the argument was omitted or not.We can provide
ArgumentValue
as a simple container for the underlying value along with a flag for whether it was omitted or not. This could be used as an alternative to@Argument
on controller method parameters, or nested within the structure of an@Argument
object.The text was updated successfully, but these errors were encountered: