Install with reference to here
npm install @apollo/client graphql
1. Install its CLI with reference to here
npm install -D @graphql-codegen/cli
2. Install its plugins with reference to here
npm install -D @graphql-codegen/typed-document-node
npm install -D @graphql-codegen/typescript
npm install -D @graphql-codegen/typescript-operations
Create or update your codegen.yaml file as follows:
schema: http://my-graphql-api.com/graphql
documents: "./src/**/*.graphql"
generates:
./src/generated.ts:
plugins:
- typescript
- typescript-operations
- typed-document-node
npx graphql-codegen
GraphQL Code Generator vs Apollo CLI
More error 🤯
error @apollo/federation@0.27.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <17.0". Got "18.3.0"
error Found incompatible module.