Created
September 28, 2019 12:05
-
-
Save talentlessguy/3e46e5a10199eef2b5e82f6629ec3e74 to your computer and use it in GitHub Desktop.
Apollo init
This file contains 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 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