Align GraphQLErrors and NetworkError errors. Fix docs #8950
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.
Continue to align error types according to changes in Align NetworkError and GraphQLErrors types #8424
Try to fix Typescript error when ignoring errors #8896
The error is:
If we look at
ExecutionResult
types at graphql,errors
can't benull
:https://github.com/graphql/graphql-js/blob/e289e6412ca59cd6298796d61efa19d78eeb945c/src/execution/execute.ts#L127-L134
So I suggest to fix docs to assign
undefined
instead ofnull
.Also we need to check if
response
exists, cause it is optional:apollo-client/src/link/error/index.ts
Lines 9 to 15 in cbcf951
So my suggestion is to check like this:
The bad part is that a lot of tests are broken in this rc:
Test Suites: 93 failed, 18 passed, 111 total
I could not brake them 🤷♂️. So please, verify these changes and merge them on your own risk. Thanks!