Skip to content

Instantly share code, notes, and snippets.

@udilbar
Forked from MrLoh/client.js
Created December 4, 2021 10:32
Show Gist options
  • Select an option

  • Save udilbar/001c9e68fe0960592f3ada82833ef00d to your computer and use it in GitHub Desktop.

Select an option

Save udilbar/001c9e68fe0960592f3ada82833ef00d to your computer and use it in GitHub Desktop.
// @flow
import { ApolloClient } from 'apollo-client';
import { ApolloLink } from 'apollo-link';
import { HttpLink } from 'apollo-link-http';
import { RetryLink } from 'apollo-link-retry';
import { AuthLink } from './link-auth';
import cache from './cache';
const retryLink = new RetryLink();
const authLink = new AuthLink();
const httpLink = new HttpLink({ uri: CINURU_API });
const link = ApolloLink.from([reduxLoggerLink, retryLink, authLink, httpLink]);
// construct client
const client = new ApolloClient({ link, cache });
// inject client dependencies
authLink.injectClient(client);
export default client;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment