examples/with-graphql-react/README.md
graphql-reactgraphql-react is a GraphQL client for React using modern context and hooks APIs that is lightweight (< 3 KB size limited) but powerful; the first Relay and Apollo alternative with server side rendering.
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-graphql-react with-graphql-react-app
yarn create next-app --example with-graphql-react with-graphql-react-app
pnpm create next-app --example with-graphql-react with-graphql-react-app
Deploy it to the cloud with Vercel (Documentation).
pages/_app.js a custom App component is decorated with the withGraphQLApp higher-order component from next-graphql-react, generating a graphql prop that populates the GraphQLProvider component from graphql-react.pages/index.js the useGraphQL React Hook from graphql-react is used to query the GraphQL Pokémon API and show a picture of Pikachu.