rsnext/examples/with-graphql-hooks/pages/_app.js
Joe Warren 5fd7b85280 Add graphql-hooks example (#6482)
Adds an example app using [graphql-hooks](https://github.com/nearform/graphql-hooks) that started life as the with-apollo example app. It uses the same graph.cool backend, mostly to demonstrate how similar it is.
2019-03-01 18:21:03 +01:00

19 lines
508 B
JavaScript

import App, { Container } from 'next/app'
import React from 'react'
import withGraphQLClient from '../lib/with-graphql-client'
import { ClientContext } from 'graphql-hooks'
class MyApp extends App {
render () {
const { Component, pageProps, graphQLClient } = this.props
return (
<Container>
<ClientContext.Provider value={graphQLClient}>
<Component {...pageProps} />
</ClientContext.Provider>
</Container>
)
}
}
export default withGraphQLClient(MyApp)