Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 730ac93

Browse files
authored
feat: retry requests on network errors (#2260)
1 parent 6277749 commit 730ac93

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

client/src/pages/_app.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@apollo/client';
99
import { NetworkError } from '@apollo/client/errors';
1010
import { onError } from '@apollo/client/link/error';
11+
import { RetryLink } from '@apollo/client/link/retry';
1112
import { offsetLimitPagination } from '@apollo/client/utilities';
1213
import { ChakraProvider } from '@chakra-ui/react';
1314
import { ConfirmContextProvider } from 'chakra-confirm';
@@ -49,8 +50,10 @@ const errorLink = onError(({ networkError }) => {
4950
}
5051
});
5152

53+
const retryLink = new RetryLink();
54+
5255
const client = new ApolloClient({
53-
link: from([errorLink, httpLink]),
56+
link: from([retryLink, errorLink, httpLink]),
5457
cache: new InMemoryCache({
5558
typePolicies: {
5659
Query: {

0 commit comments

Comments
 (0)