Skip to content
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

[gql_websocket_link] Parse errors and extension in error message type use websocket_status.normalClosure #280

Merged
merged 4 commits into from
Nov 2, 2021

Conversation

juancastillo0
Copy link
Contributor

Fixes 237 and 260.
Improves on 278 to fix 260 by using websocket_status.normalClosure instead of websocket_status.goingAwayto support web (replicated the issue and tested on a browser).

Hi, from the conversation in 237 I added errors and extensions field in SubscriptionError, the parsing checks if the error objects are of the right format for ResponseParser.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 the errors[0].extension and response.entry<ResponseExtensions>()!.extensions. I left the complete payload in the SubscriptionError.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!

@vysotsky
Copy link

Any updates on this PR when it might be merged? I need this and I will be really thankful if you merge it. Thanks!

@agent3bood agent3bood merged commit 6912240 into gql-dart:master Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants