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'
8787/* generates validation schema here */
8888` ` `
8989
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+
90118# ## `useTypeImports`
91119
92120type : ` boolean` default: `false`
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
7070 * config:
7171 * schema: yup
7272 * importFrom: ./path/to/types
73- * namespacedImportName : types
73+ * schemaNamespacedImportName : types
7474 * ```
7575 */
7676 schemaNamespacedImportName ?: string
You can’t perform that action at this time.
0 commit comments