Skip to main content

@kazekyo/nau-graphql-codegen-preset

This preset extends your schema required to run Nau, modifies GraphQL documents you have written, and generates TypeScript Code.

schema: http://localhost:4000/graphql
documents:
- src/**/*.tsx
generates:
src/generated/graphql.ts:
preset: '@kazekyo/nau-graphql-codegen-preset'
presetConfig:
generateTypeScriptCode: true
plugins:
- typescript
- typescript-operations
- typed-document-node
src/generated/introspection-result.json:
preset: '@kazekyo/nau-graphql-codegen-preset'
plugins:
- fragment-matcher
./schema.graphql:
preset: '@kazekyo/nau-graphql-codegen-preset'
plugins:
- schema-ast

Preset Config

generateTypeScriptCode

type: boolean default: false

If set to true, It generates TypeScript code. For example, withCacheUpdater is generated by enabling this option. The default is false.