question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RetryLink no retrying with @apollo/client version 3.1.3

See original GitHub issue

Intended 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:

  1. Go to https://codesandbox.io/s/pedantic-sun-wrotv?file=/src/App.js
  2. 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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

2reactions
bfreemancommented, Mar 7, 2022

I’m encountering it as well. Any word on getting this resolved? Or is there a decent work around?

0reactions
mshickcommented, Nov 6, 2022

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 if RetryLink could evaluate any error for retry, rather than just network errors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retry Link - Apollo GraphQL Docs
@apollo/client/link/retry provides exponential backoff, and jitters delays between attempts by default. It does not (currently) handle retries for GraphQL ...
Read more >
Migrating to Apollo Client 3.0 - Apollo GraphQL Docs
This article walks you through migrating your application to Apollo Client 3.0 from previous versions of Apollo Client. To illustrate the migration process, ......
Read more >
Handling operation errors - Apollo GraphQL Docs
Apollo Link helps you retry failed operations that might be resolved by a followup attempt. We recommend different links depending on the type...
Read more >
Migrating to Apollo Kotlin 3.0 - Apollo GraphQL Docs
The compatibility helpers will be removed in a future version of Apollo Kotlin ... On Apollo Android 2.x you would use the ApolloClient.builder()...
Read more >
Apollo Link overview - Apollo GraphQL Docs
Customize Apollo Client's data flow. ... BEFORE (NO INTERACTION). 2. return forward(operation); ... import { RetryLink } from '@apollo/client/link/retry';.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found