Last active
June 11, 2018 13:08
-
-
Save SaraVieira/2489f2ad0b8959130bc5e23fde57c06d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import { ApolloClient } from 'apollo-client' | |
import { HttpLink } from 'apollo-link-http' | |
export default new ApolloClient({ | |
connectToDevTools: process.browser, | |
ssrMode: !process.browser, | |
link: new HttpLink({ | |
uri: 'https://api.graphcms.com/simple/v1/cjhdcwrb98if90109o4pzawaq' | |
}), | |
cache: process.browser | |
? new InMemoryCache().restore(window.__APOLLO_STATE__) | |
: new InMemoryCache() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment