Files
nhost/deprecated/examples/codegen-react-apollo

GraphQL Code Generator Example with React and Apollo Client

Todo app to show how to use:

This repo is a reference repo for the blog post: How to use GraphQL Code Generator with React and Apollo.

Get Started

  1. Clone the repository
git clone https://github.com/nhost/nhost
cd nhost
  1. Install and build dependencies
pnpm install
pnpm run build
  1. Go to the example folder
cd examples/codegen-react-urql
  1. Terminal 1: Start Nhost
nhost up -d
  1. Terminal 2: Start the React application
pnpm run dev

GraphQL Code Generators

To re-run the GraphQL Code Generators, run the following:

pnpm codegen -w

-w runs codegen in watch mode.