rsnext/examples/with-graphql-hooks/pages/_app.js
Ludovico Fischer b3a631305d
fix(examples): make with-graphql-hooks run correctly again (#20929)
Fixes #20474

* Switch API url to working URL used in apollo example
* Update deps
* Move styled jsx out of the way to avoid demonstrating too many
  unfamiliar concepts at once

dev, build and start work now.
2021-01-11 13:55:18 +00:00

13 lines
389 B
JavaScript

import '../styles.css'
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>
)
}