File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { transformSchemaAST } from "@graphql-codegen/schema-ast" ;
2
2
import { YupSchemaVisitor } from "./yup/index" ;
3
3
import { ValidationSchemaPluginConfig } from "./config" ;
4
- import { oldVisit , PluginFunction , Types } from "@graphql-codegen/plugin-helpers" ;
4
+ import {
5
+ oldVisit ,
6
+ PluginFunction ,
7
+ Types ,
8
+ } from "@graphql-codegen/plugin-helpers" ;
5
9
import { GraphQLSchema } from "graphql" ;
6
10
7
- export const plugin : PluginFunction < ValidationSchemaPluginConfig > = async (
11
+ export const plugin : PluginFunction < ValidationSchemaPluginConfig > = (
8
12
schema : GraphQLSchema ,
9
13
_documents : Types . DocumentFile [ ] ,
10
14
config : ValidationSchemaPluginConfig
11
- ) : Promise < Types . PluginOutput > => {
15
+ ) : Types . PluginOutput => {
12
16
const { schema : _schema , ast } = transformSchemaAST ( schema , config ) ;
13
17
const { buildImports, ...visitor } = YupSchemaVisitor ( _schema , config ) ;
14
18
15
19
const result = oldVisit ( ast , {
16
- leave : visitor
20
+ leave : visitor ,
17
21
} ) ;
18
22
19
23
// @ts -ignore
@@ -24,5 +28,3 @@ export const plugin: PluginFunction<ValidationSchemaPluginConfig> = async (
24
28
content : "\n" + [ ...generated ] . join ( "\n" ) ,
25
29
} ;
26
30
} ;
27
-
28
- export default plugin ;
You can’t perform that action at this time.
0 commit comments