import "colors" ; import { ApolloClient , createHttpLink , InMemoryCache } from '@apollo/client' ; import { setContext } from '@apollo/client/link/context' ; import getConfig from 'next/config' ; const { publicRuntimeConfig } = getConfig ( ) ; const httpLink = createHttpLink ( { uri : publicRuntimeConfig . domainApiGraphql || "https://api-v2.staging.bonde.org/graphql" , } ) ; const authLink = setContext ( ( _ , { headers } ) => { return { headers : { ... headers , } } ; } ) ; export const client = new ApolloClient ( { link : authLink . concat ( httpLink ) , cache : new InMemoryCache ( ) } ) ;