Skip to content

Commit fcccc86

Browse files
committed
fixed documentation
1 parent 988402c commit fcccc86

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ type: `ScalarSchemas`
152152

153153
Extends or overrides validation schema for the built-in scalars and custom GraphQL scalars.
154154

155+
### `withObjectType`
156+
157+
type: `boolean` default: `false`
158+
159+
Generates validation schema with GraphQL type objects. But excludes `Query`, `Mutation`, `Subscription` objects.
160+
155161
#### yup schema
156162

157163
```yml

codegen.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ generates:
99
- ./dist/main/index.js:
1010
schema: yup
1111
importFrom: ../types
12-
useObjectTypes: true
12+
withObjectType: true
1313
directives:
1414
required:
1515
msg: required
@@ -43,7 +43,7 @@ generates:
4343
- ./dist/main/index.js:
4444
schema: zod
4545
importFrom: ../types
46-
useObjectTypes: true
46+
withObjectType: true
4747
directives:
4848
# Write directives like
4949
#
@@ -64,7 +64,7 @@ generates:
6464
- ./dist/main/index.js:
6565
schema: myzod
6666
importFrom: ../types
67-
useObjectTypes: true
67+
withObjectType: true
6868
directives:
6969
constraint:
7070
minLength: min

src/config.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,25 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
152152
* ```
153153
*/
154154
scalarSchemas?: ScalarSchemas;
155+
/**
156+
* @description Generates validation schema with GraphQL type objects.
157+
* but excludes "Query", "Mutation", "Subscription" objects.
158+
*
159+
* @exampleMarkdown
160+
* ```yml
161+
* generates:
162+
* path/to/types.ts:
163+
* plugins:
164+
* - typescript
165+
* path/to/schemas.ts:
166+
* plugins:
167+
* - graphql-codegen-validation-schema
168+
* config:
169+
* schema: yup
170+
* withObjectType: true
171+
* ```
172+
*/
173+
withObjectType?: boolean;
155174
/**
156175
* @description Generates validation schema with more API based on directive schema.
157176
* @exampleMarkdown
@@ -193,23 +212,4 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
193212
* ```
194213
*/
195214
directives?: DirectiveConfig;
196-
/**
197-
* @description Generates validation schema with graphql type objects.
198-
* but excludes "Query", "Mutation", "Subscription" objects.
199-
*
200-
* @exampleMarkdown
201-
* ```yml
202-
* generates:
203-
* path/to/types.ts:
204-
* plugins:
205-
* - typescript
206-
* path/to/schemas.ts:
207-
* plugins:
208-
* - graphql-codegen-validation-schema
209-
* config:
210-
* schema: yup
211-
* withObjectType: true
212-
* ```
213-
*/
214-
withObjectType?: boolean;
215215
}

0 commit comments

Comments
 (0)