How to execute an async fetch request and then retry last failed request?
Apollo link offers an error handler onError Issue: Currently, we wish to refresh oauth tokens when they expires during an apollo call and we are unable to execute an async fetch request inside the onError properly. Code: initApolloClient.js import { ApolloClient } from 'apollo-client'; import { onError } from 'apollo-link-error'; import { ApolloLink, fromPromise } from 'apollo-link'; //Define Http link const httpLink = new createHttpLink({ uri: '/my-graphql-endpoint', credentials: 'include' }); //Add on error handler for apollo link return new ApolloClient({ link: ApolloLink.from([ onError(({