RetryLink no retrying with @apollo/client version 3.1.3
See original GitHub issueIntended outcome:
RetryLink
from @apollo/client/link/retry
should retry the request when an error is thrown. RetryLink
is used in combination with onError
from @apollo/client/link/error
. The error is caught by onError
but RetryLink
does not retry the operation.
Actual outcome:
The error is caught by onError
but RetryLink
does not retry the operation. The error is also caught in the const { error } = useQuery()
hook.
How to reproduce the issue:
- Go to https://codesandbox.io/s/pedantic-sun-wrotv?file=/src/App.js
- See that an error is thrown, but not retried.
This example uses https://rickandmortyapi.com/ as example.
Versions
System: OS: Linux 5.8 Arch Linux Binaries: Node: 14.6.0 - /usr/local/bin/node Yarn: 1.22.4 - ~/.yarn/bin/yarn npm: 6.14.6 - /usr/local/bin/npm Browsers: Firefox: 80.0 npmPackages: @apollo/client: ^3.1.3 => 3.1.3 @apollo/react-hooks: ^4.0.0 => 4.0.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:6
I’m encountering it as well. Any word on getting this resolved? Or is there a decent work around?
My issue is as @vinverdy describes — I need to retry on a category of GraphQL error (with backoff) but
RetryLink
never receives the errors. It would make sense to me ifRetryLink
could evaluate any error for retry, rather than just network errors.