File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,34 @@ import { GeneratedInput } from './graphql'
87
87
/* generates validation schema here */
88
88
` ` `
89
89
90
+ # ## `schemaNamespacedImportName`
91
+
92
+ type : ` string`
93
+
94
+ If defined, will use named imports from the specified module (defined in `importFrom`) rather than individual imports for each type.
95
+
96
+ ` ` ` yml
97
+ generates:
98
+ path/to/types.ts:
99
+ plugins:
100
+ - typescript
101
+ path/to/schemas.ts:
102
+ plugins:
103
+ - graphql-codegen-validation-schema
104
+ config:
105
+ schema: yup
106
+ importFrom: ./path/to/types
107
+ schemaNamespacedImportName: types
108
+ ` ` `
109
+
110
+ Then the generator generates code with import statement like below.
111
+
112
+ ` ` ` ts
113
+ import * as types from './graphql'
114
+
115
+ /* generates validation schema here */
116
+ ` ` `
117
+
90
118
# ## `useTypeImports`
91
119
92
120
type : ` boolean` default: `false`
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
70
70
* config:
71
71
* schema: yup
72
72
* importFrom: ./path/to/types
73
- * namespacedImportName : types
73
+ * schemaNamespacedImportName : types
74
74
* ```
75
75
*/
76
76
schemaNamespacedImportName ?: string
You can’t perform that action at this time.
0 commit comments