-
-
Notifications
You must be signed in to change notification settings - Fork 140
feat(graphql-client): throw a descriptive error #826
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
feat(graphql-client): throw a descriptive error #826
Conversation
|
I also added a fix for the following error: |
|
@NickBolles that's a good idea and a better behavior thanks for this 👍 |
|
@pradel it looks like there's a potential to have multiple errors, and it's not possible to throw multiple errors, so I made a wrapper for it and let the consumer have access to the raw list of errors via the |
|
@pradel should we check if there's only one error and throw that error by itself, otherwise throw the errorList? |
|
@NickBolles I think it's fine that way :) do you think you could add an example of how to handle the error in the graphql documentation? |
|
sorry that took so long, I didn't see your response till now. Just added a little blurb about it. Let me know if you think it needs any changes. While I was at it I updated the example to be more accurate (at least in my experience) |
ducan-ne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
|
@NickBolles sorry I didn't get back to it earlier. Can you please resolve the conflicts you have so I can merge it? :) |
|
@pradel done! |
|
@NickBolles looks like the tests are failing, can you please take a look? |
|
@pradel that should be fixed now. Sorry for the huge delay |
|
Thank you @NickBolles! |
This is a proposal for how to throw messages..
Before, data would be undefined and we would try to access the result field on data resulting in the following message:
After the change you get this message:
Close #823