b4ec992815
Related to https://github.com/vercel/next.js/issues/11014 The setup is very similar to the one used for Apollo examples. @Joezo I've removed the demo example that you added to the readme (https://github.com/vercel/next.js/pull/6482) as it will be outdated after this PR is merged.
12 lines
366 B
JavaScript
12 lines
366 B
JavaScript
import { ClientContext } from 'graphql-hooks'
|
|
import { useGraphQLClient } from '../lib/graphql-client'
|
|
|
|
export default function App({ Component, pageProps }) {
|
|
const graphQLClient = useGraphQLClient(pageProps.initialGraphQLState)
|
|
|
|
return (
|
|
<ClientContext.Provider value={graphQLClient}>
|
|
<Component {...pageProps} />
|
|
</ClientContext.Provider>
|
|
)
|
|
}
|