This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Subscription does not handle properly NonNullableFieldWasNullException #378
Closed
Description
NonNullableFieldWasNullException
s are apparently not properly handled in case of subscriptions. Take the following schema as an example:
type Foo {
bar: String!
}
type Query {
foo: Foo!
}
type Subscription {
foo: Foo!
}
If Foo.bar
is null
, the query returns the following specification-compliant response:
{
"errors": [
{
"message": "Cannot return null for non-nullable type: 'String' within parent 'Foo' (/foo/bar)",
"path": [
"foo",
"bar"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
}
However, the subscription only sends the following message to the client:
{"type":"error","id":"1"}
GraphQL Playground displays the following error message:
{
"error": {
"name": "FormatedError",
"message": "Unknown error"
}
}
Other clients, however, may go into an infinite loading/waiting state, not recognizing that an error occurred.
Tested version: 7.0.1