Commit 0770470b authored by Jayden Seric's avatar Jayden Seric Committed by Luis Fernando Alvarez D

Update the with-graphql-react example. (#7317)

- Update dependencies, especially graphql-react.
- Use the graphql-react v8.2.0 API.
- Use a /* GraphQL */ comment template string tag so text editors can syntax highlight, lint and format the GraphQL query.
parent b5e3aac1
......@@ -3,12 +3,12 @@
"private": true,
"license": "ISC",
"dependencies": {
"cross-fetch": "^3.0.1",
"graphql-react": "^8.0.2",
"next": "^8.0.3",
"next-graphql-react": "^3.0.0",
"react": "^16.8.3",
"react-dom": "^16.8.3"
"cross-fetch": "^3.0.2",
"graphql-react": "^8.2.0",
"next": "^8.1.0",
"next-graphql-react": "^3.0.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"scripts": {
"dev": "next",
......
import 'cross-fetch/polyfill'
import { GraphQLContext } from 'graphql-react'
import { GraphQLProvider } from 'graphql-react'
import { withGraphQLApp } from 'next-graphql-react'
import App, { Container } from 'next/app'
......@@ -8,9 +8,9 @@ class CustomApp extends App {
const { Component, pageProps, graphql } = this.props
return (
<Container>
<GraphQLContext.Provider value={graphql}>
<GraphQLProvider graphql={graphql}>
<Component {...pageProps} />
</GraphQLContext.Provider>
</GraphQLProvider>
</Container>
)
}
......
......@@ -6,7 +6,7 @@ export default () => {
options.url = 'https://graphql-pokemon.now.sh'
},
operation: {
query: `
query: /* GraphQL */ `
{
pokemon(name: "Pikachu") {
name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment