You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ShourovRoy you are not awaiting for your getNewToken which is async.
Even so, that would require you to change the function you're passing to onError to an async function, but onError does not await on the function you pass in, so your approach will not work.
Here is my code and when I am trying to retry using forward(operation) by setting the header with new access token the retry is not working.
Here is the code:
const getNewToken = async () => {
}
const interceptors = onError(({ networkError, forward, operation, graphQLErrors }) => {
})
const httpLink = new HttpLink({ uri: 'http://localhost:4000/graphql' });
export const client = new ApolloClient({
link: interceptors.concat(httpLink),
cache: new InMemoryCache(),
ssrMode: true,
});
function MyApp({ Component, pageProps }) {
return (
<Component {...pageProps} />
)
}
export default MyApp
The text was updated successfully, but these errors were encountered: