File tree Expand file tree Collapse file tree 3 files changed +28
-22
lines changed Expand file tree Collapse file tree 3 files changed +28
-22
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,12 @@ type: `ScalarSchemas`
152
152
153
153
Extends or overrides validation schema for the built-in scalars and custom GraphQL scalars.
154
154
155
+ # ## `withObjectType`
156
+
157
+ type : ` boolean` default: `false`
158
+
159
+ Generates validation schema with GraphQL type objects. But excludes `Query`, `Mutation`, `Subscription` objects.
160
+
155
161
# ### yup schema
156
162
157
163
` ` ` yml
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ generates:
9
9
- ./dist/main/index.js :
10
10
schema : yup
11
11
importFrom : ../types
12
- useObjectTypes : true
12
+ withObjectType : true
13
13
directives :
14
14
required :
15
15
msg : required
@@ -43,7 +43,7 @@ generates:
43
43
- ./dist/main/index.js :
44
44
schema : zod
45
45
importFrom : ../types
46
- useObjectTypes : true
46
+ withObjectType : true
47
47
directives :
48
48
# Write directives like
49
49
#
@@ -64,7 +64,7 @@ generates:
64
64
- ./dist/main/index.js :
65
65
schema : myzod
66
66
importFrom : ../types
67
- useObjectTypes : true
67
+ withObjectType : true
68
68
directives :
69
69
constraint :
70
70
minLength : min
Original file line number Diff line number Diff line change @@ -152,6 +152,25 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
152
152
* ```
153
153
*/
154
154
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 ;
155
174
/**
156
175
* @description Generates validation schema with more API based on directive schema.
157
176
* @exampleMarkdown
@@ -193,23 +212,4 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
193
212
* ```
194
213
*/
195
214
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 ;
215
215
}
You can’t perform that action at this time.
0 commit comments