import { InMemoryCache } from 'apollo-boost' ; import ApolloClient from 'apollo-client' ; import { createHttpLink } from 'apollo-link-http' ; import { setContext } from 'apollo-link-context' ; const httpLink = createHttpLink ( { uri : 'http://localhost:4000/graphql' , } ) ; const authLink = setContext ( async ( op , ctx ) => { return { ... ctx , } ; } ) ; const apolloClient = new ApolloClient ( { link : authLink . concat ( httpLink ) , cache : new InMemoryCache ( ) , } ) ; export default apolloClient ;