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
queryMyQuery($after: String) {
items(after: $after) {
name
}
}
and no variable values provided:
Operation: MyQuery, Variables: {}
...the expected behavior is that after is absent from the context.arguments object passed to the resolver function, but instead after is present with an explicit null value:
{
"after": null
}
This makes it impossible to differentiate between absent and null when the client is using variables.
If a variable is used for a nullable query argument, the resolver function will see an explicit
null
even if no value was provided for the variable.For example, given this schema snippet:
and this query:
and no variable values provided:
...the expected behavior is that
after
is absent from thecontext.arguments
object passed to the resolver function, but insteadafter
is present with an explicitnull
value:This makes it impossible to differentiate between absent and
null
when the client is using variables.Here is the relevant section of the GraphQL spec: https://spec.graphql.org/October2021/#sec-Coercing-Variable-Values
The text was updated successfully, but these errors were encountered: