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
When null is returned for a non-nullable field, graphql-go-tools usually bubbles the null to the nearest nullable parent and adds an error indicating that the original field with the null value couldn't be resolved. This doesn't always happen, though.
Here are some examples that can be run in the examples/federation playground:
query($skip:Boolean!){
me {
reviews {
author {
username
}
body @skip(if:$skip)
product {
name
}
}
}
}
In this case "body" is non-nullable, so the null due to the @skip (which itself is a bug reported in #320) bubbles up to the nearest nullable type, which is Review (hence the list of nulls).
Note the lack of an error.
Here's another example:
query($skip:Boolean!){
me {
username @skip(if:$skip)
}
}
Returns:
{
"data": {
"me": null
}
}
Here are an example that works as expected:
query($skip:Boolean!){
me {
reviews {
author {
username
}
body
product {
name @skip(if:$skip)
}
}
}
}
(Though I believe in this case the path should be [..., "product", "name"] instead of ending at just "product" according to the section of the GraphQL spec on this matter.)
The text was updated successfully, but these errors were encountered:
When null is returned for a non-nullable field, graphql-go-tools usually bubbles the null to the nearest nullable parent and adds an error indicating that the original field with the null value couldn't be resolved. This doesn't always happen, though.
Here are some examples that can be run in the examples/federation playground:
Returns:
In this case "body" is non-nullable, so the null due to the
@skip
(which itself is a bug reported in #320) bubbles up to the nearest nullable type, which is Review (hence the list of nulls).Note the lack of an error.
Here's another example:
Returns:
Here are an example that works as expected:
Returns:
(Though I believe in this case the path should be [..., "product", "name"] instead of ending at just "product" according to the section of the GraphQL spec on this matter.)
The text was updated successfully, but these errors were encountered: