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
While working on an issue in graphql-ruby, I needed clarity on the expected behaviour of variables with default values and null value in the following example:
Query
query ($id: ID = 4) {
film(filmID: $id) {
title
}
}
Variables
{
"id": null
}
In graphql-js, null takes precedence over the default value of $id and the film resolver receives filmID: null.
The spec suggests the following algorithm for dealing with this case:
However, I got a bit confused when I read this:
It might just be me, but I got confused with "represent the lack of a value" and "if value does not exist".