Skip to content

Instantly share code, notes, and snippets.

@talentlessguy
Created September 28, 2019 12:05
Show Gist options
  • Save talentlessguy/3e46e5a10199eef2b5e82f6629ec3e74 to your computer and use it in GitHub Desktop.
Save talentlessguy/3e46e5a10199eef2b5e82f6629ec3e74 to your computer and use it in GitHub Desktop.
Apollo init
import withApollo from 'next-with-apollo'
import ApolloClient, { InMemoryCache, HttpLink } from 'apollo-boost'
import { parseCookies } from 'nookies'
export default withApollo(
({ initialState }) =>
new ApolloClient({
link: new HttpLink({
uri: 'https://api.komfy.now.sh/graphql',
headers: {
authorization: ''
}
}),
cache: new InMemoryCache().restore(initialState || {})
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment