Files
task-stream/codegen.ts
2026-10-03 13:40:26 +02:00

32 lines
940 B
TypeScript

import type { CodegenConfig } from '@graphql-codegen/cli';
/**
* Typed GraphQL operations for the web client, generated from the API schema
* (apps/api/schema.gql, written by the API on start in development).
*
* npx nx run web:codegen
*/
const plugins = ['typescript-operations', 'typed-document-node'];
const config: CodegenConfig = {
overwrite: true,
schema: 'apps/api/schema.gql',
config: {
enumsAsTypes: true,
useTypeImports: true,
avoidOptionals: { field: true, inputValue: false },
scalars: { ID: 'string' },
},
generates: {
'libs/web/tracker/infrastructure/src/lib/graphql/generated.ts': {
documents: 'libs/web/tracker/infrastructure/src/lib/graphql/*.graphql',
plugins,
},
'libs/web/identity/infrastructure/src/lib/graphql/generated.ts': {
documents: 'libs/web/identity/infrastructure/src/lib/graphql/*.graphql',
plugins,
},
},
};
export default config;