From 96fe118a88c8234f06e5a02568764a1bc882b76e Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Mon, 16 Mar 2020 21:27:32 +0300 Subject: [PATCH] restore --- apolloClient.js | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 apolloClient.js diff --git a/apolloClient.js b/apolloClient.js deleted file mode 100644 index efafcff..0000000 --- a/apolloClient.js +++ /dev/null @@ -1,18 +0,0 @@ -import { ApolloClient } from 'apollo-client' -import { InMemoryCache } from 'apollo-cache-inmemory' -import { HttpLink } from 'apollo-link-http' -import fetch from 'isomorphic-unfetch' - -export default function createApolloClient (initialState, ctx) { - // The `ctx` (NextPageContext) will only be present on the server. - // use it to extract auth headers (ctx.req) or similar. - return new ApolloClient({ - ssrMode: Boolean(ctx), - link: new HttpLink({ - uri: 'https://next-blog-example.herokuapp.com/graphql', // Server URL (must be absolute) - credentials: 'same-origin', // Additional fetch() options like `credentials` or `headers` - fetch - }), - cache: new InMemoryCache().restore(initialState) - }) -}