Create-React-App

Codegen for React Apollo with TypeScript. Generates React Hooks and TypeScript types.

Since v2 of Create-React-App, you can use TypeScript without the need to eject from the basic scripts packages.

codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  schema: 'http://my-server/graphql',
  documents: 'src/**/*.graphql',
  generates: {
    'components.tsx': {
      plugins: ['typescript-operations', 'typescript-react-apollo']
    }
  }
}
export default config