Skip to content

Instantly share code, notes, and snippets.

@GiselaMD
GiselaMD / client.ts
Last active September 23, 2021 11:22
ApolloClient with token authentication and refresh token
import { HttpLink } from 'apollo-link-http';
import { ApolloClient, DefaultOptions } from 'apollo-client';
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloLink } from 'apollo-link';
import { resolvers } from './resolvers';
import { typeDefs } from './schema/typeDefs';
import { errorLink } from './error';
import { requestLink } from './requestLink';
import customFetch from './customFetch';