5fd7b85280
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.
19 lines
508 B
JavaScript
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)
|