Skip to content

Instantly share code, notes, and snippets.

View rutvikbhatt9's full-sized avatar
🎯
Focusing on new learning

Rutvik Bhatt rutvikbhatt9

🎯
Focusing on new learning
View GitHub Profile
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: {