first commit
This commit is contained in:
31
codegen.ts
Normal file
31
codegen.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user