-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: 'errors' property is never populated for GraphQL subscriptions #914
Labels
bug
Something isn't working
Comments
Thanks for reporting with such a detail set of instructions. |
Shouldn't Line 121 in ac8c708
Be - val message = OperationMessage(GQL_DATA, DataPayload(er.getData()), id)
+ val message = OperationMessage(GQL_DATA, DataPayload(er.getData(), er.getErrors()), id)
// or Kotlin probably:
+ val message = OperationMessage(GQL_DATA, DataPayload(er.getData(), er.errors), id) See line 70 Lines 66 to 71 in ac8c708
SSE does have it Line 99 in ac8c708
|
Yes, that is the issue. We will fix this in the upcoming release. |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
When I receive an event in the Response Stream for a GraphQL subscription, I expect the
errors
property to be non-empty if an error occurred for any field during the execution of the GraphQL operation.Actual behavior
The
errors
property is always empty.Steps to reproduce
These steps are based on a slightly modified version of https://github.com/Netflix/dgs-examples-kotlin .
1
Get a local copy of raindrop23/dgs-examples-kotlin@d44060a . (That commit is the only change I made after forking dgs-examples-kotlin.)
2
Start the GraphQL web service locally.
3
Install websocat. (Here are installation instructions.)
4
Run this command:
5
Paste in the following line:
Paste it in as a full line, so that the cursor goes to the start of the next line.
6
Paste in the following line:
Again, paste it in as a full line.
7
In a local web browser, access GraphiQL at http://localhost:8080/graphiql. Enter the following GraphQL operation and execute it.
8
Look at the terminal where
websocat
is running. Observe that the review has appeared as an event in the Response Stream. Observe that the value ofipAddress
is "1.1.1.1".9
Return to GraphiQL. Slightly edit the value of
username
andstarScore
to produce the following operation, then execute it.10
In the output of the local GraphQL web service, observe that a stack trace has appeared, preceded by the message "Exception while executing data fetcher for /reviewAdded/ipAddress: null". (That message is because an exception was thrown on this line of code.)
11
Look at the terminal where
websocat
is running. Observe that the review has appeared as an event in the Response Stream. Observe that the value ofipAddress
isnull
. Observe also that the value of theerrors
property is an empty array.Discussion
Further to the last step: it's clear from the GraphQL specification that
errors
should be non-empty. Section 6.2.3.2 says:Clean-up
You can terminate the
websocat
process by typing Control-C.The text was updated successfully, but these errors were encountered: