[gql_websocket_link] Parse errors and extension in error message type use websocket_status.normalClosure #280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes 237 and 260.
Improves on 278 to fix 260 by using
websocket_status.normalClosure
instead ofwebsocket_status.goingAway
to support web (replicated the issue and tested on a browser).Hi, from the conversation in 237 I added
errors
andextensions
field inSubscriptionError
, the parsing checks if the error objects are of the right format forResponseParser.parseError
. The root (response) extensions are only passed if the payload could not be parsed as an error, since otherwise they would be duplicated in theerrors[0].extension
andresponse.entry<ResponseExtensions>()!.extensions
. I left the complete payload in theSubscriptionError.toJson
in case anyone was using that, however, I can remove it if you think that's better.Adds a test with different payload formats. A map with "errors" field, a map with "errors" field and response "extensions", a list of errors and a single error.
Please, tell me if there is something that I could change to improve the PR or anything else you want to discuss.
Thank you!