• Docs
  • Integrations
  • create-react-app

Create-React-App

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', 'typescript-operations', 'typescript-react-apollo']
    }
  }
}
export default config
Last updated on October 13, 2022