This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient, ApolloLink, Observable, InMemoryCache } from "@apollo/client"; | |
import { onError } from "@apollo/client/link/error"; | |
import { RetryLink } from "@apollo/client/link/retry"; | |
import { createUploadLink } from 'apollo-upload-client' | |
const request = async (operation) => { | |
const token = "yourToken"; // you can get token from persistent storage or redux store | |
console.log('REQUESTING', operation.operationName, operation.variables); | |
operation.setContext({ | |
headers: { |
OlderNewer