Skip to content

Commit 0c5768c

Browse files
committed
feat: add validationSchemaExportType to config
1 parent b53a18f commit 0c5768c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { TypeScriptPluginConfig } from '@graphql-codegen/typescript';
22

33
export type ValidationSchema = 'yup' | 'zod' | 'myzod';
4+
export type ValidationSchemaExportType = 'function' | 'const';
45

56
export interface DirectiveConfig {
67
[directive: string]: {
@@ -234,4 +235,20 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
234235
* ```
235236
*/
236237
directives?: DirectiveConfig;
238+
/**
239+
* @description Specify validation schema export type
240+
* @default function
241+
*
242+
* @exampleMarkdown
243+
* ```yml
244+
* generates:
245+
* path/to/file.ts:
246+
* plugins:
247+
* - typescript
248+
* - graphql-codegen-validation-schema
249+
* config:
250+
* validationSchemaExportType: const
251+
* ```
252+
*/
253+
validationSchemaExportType?: ValidationSchemaExportType;
237254
}

0 commit comments

Comments
 (0)