-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Makes error handling more consistent #9941
Makes error handling more consistent #9941
Conversation
Super cool @MrDoomBringer (which is an appropriate GH username for working on error PR's 😂). Let us know when you think this is ready for review (holding off for now since it's still in draft). Thanks! |
Mutations basic run ApolloLink Revert "Mutations basic run" This reverts commit b3a130d. Test support Rename error_network -> errorNetwork onError link support bump bundlesize from 29.95 -> 29.98KB Consolidate errorNetwork away
1fb4dbb
to
27c85d0
Compare
@MrDoomBringer feel free to ping me when the conflicts are resolved and I'll take a look 👍 |
Hey @alessbell! I think this PR needs a bit more work, so I'll be putting it on the backburner for now. Definitely some good preliminary work in here through that should be useful when it's time to revisit it. |
See this Issue for more information: #9870
This PR aims to make the
networkError
andgraphQLErrors
fields on the result object behave as expected for all react hooks - on any 4/500 error codenetworkError
will be populated, and if there's any GraphQL error from the server, it will be present in that field.Behavior currently looks good with useQuery, useSubscription, and ApolloLink.
I tried to make the implementation as non-intrusive as possible, both for backwards compatability and to hopefully prevent regressions by touching too much code.
TODO: Add test coverage
Checklist: