This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
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.
Alternative fix for #2253
FWIW, as a consumer #2253 seems like a very substantial bug.
errorPolicy: all
is the recommended configuration and proper error handling is the most critical path to test, but there's no good way to test graphql errors in a Mutation now except to force it to generate a runtime error usingerrorPolicy: none
and wrap all of your mutations in atry/catch
. Then again, I may just be salty about this because it took me days to understand the root of the issue.Differences from existing PR #2297:
onComplete
when errors are handled graphQL errors, and do not callonError
(Why not call
onError
when the error is a graphQL error? It seems like the intended use ofonError
is when you want to hook into the flow of unhandled errors; say, to send to an error aggregation facility, but the error really is an unexpected error and you will still ultimately end up callingthrow new Error
. When we geterrors
in the mutation'sFetchResult
, these are expected errors that should be handled, as opposed to code errors, and they should be handled in the render prop function)Checklist:
If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.