-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apollo v3 Beta not working with RetryLink and onError #6503
Comments
I am seeing the same thing after updating from
|
I am using RetryLink and onError without issue using @apollo/client 3.0.2. My link imports look different from yours, things must have changed now that v3 is out of beta. For other readers, make sure you chain your links together in the correct order. The terminating link must be last, so onError and RetryLink should be first in the array passed to import { ApolloClient, ApolloLink } from '@apollo/client';
import { RetryLink } from '@apollo/client/link/retry';
import { onError } from '@apollo/client/link/error';
import authLink from './authLink'; //exports a BatchHttpLink object from '@apollo/client/link/batch-http';
const retryLink = new RetryLink();
//log query errors
const errorLink = onError(error => {
const { graphQLErrors, networkError } = error;
if (graphQLErrors)
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
);
if (networkError) console.log(`[Network error]: ${networkError}`, networkError);
});
const client = new ApolloClient({
link: ApolloLink.from([errorLink, retryLink, authLink]),
...
}); |
This should no longer be an issue in |
Hi again,
Sorry if this is a wrong place to ask this question, new to this community. already asked same question here apollographql/apollo-link#1289
ApolloLink not working for me properly. I'm getting error while adding
in the Apollo Client V3 beta
Error is:
My packages are following:
tried resolution solution as per many google searches inside the package.json as
but error stays same.
My code is following:
The text was updated successfully, but these errors were encountered: