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
queryListArticles($includeDeleted: Boolean) {
articles(includeDeleted: $includeDeleted) { title }
}
Calling the query without providing $includeDeleted will result in null being passed into articles( i.e: articles(includeDeleted: null) while includeDeleted was specified to default to false. Changing the above query to:
This is actually an interesting case where I'd have to read the spec in order to understand exactly what is going on. I don't know the rules of how the expansion should proceed in this case. A rough guess is that if you don't provide $includeDeleted and that parameter has no default, then the default value of the field in the schema should take precedence.
I'll have to dig a bit in the spec to figure this one out as well, and then create a test case for it.
Since Jun2018 spec, this is now a bug. The details are in #166, and we can clarify how resolution should happen. The spec now:
accepts not providing a parameter if there is a default value for the parameter in the schema, and it doesn't matter if the argument in which the parameter is used is non-null or nullable.
So this is a bug which hinges on us becoming Jun2018 spec compliant (which we currently aren't. A couple of smaller things are missing).
Not sure if this is a bug or a feature.
Given the schema:
And the query:
Calling the query without providing
$includeDeleted
will result innull
being passed intoarticles
( i.e:articles(includeDeleted: null
) whileincludeDeleted
was specified to default tofalse
. Changing the above query to:will achieve the desired result but that's a repetition of default value.
GraphQL commit:
135657f745254198f3d07e35fd3a63623144b119
The text was updated successfully, but these errors were encountered: