File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,14 @@ import {
8
8
} from "@graphql-codegen/plugin-helpers" ;
9
9
import { GraphQLSchema } from "graphql" ;
10
10
11
- export const plugin : PluginFunction < ValidationSchemaPluginConfig > = (
11
+ export const plugin : PluginFunction <
12
+ ValidationSchemaPluginConfig ,
13
+ Types . ComplexPluginOutput
14
+ > = (
12
15
schema : GraphQLSchema ,
13
16
_documents : Types . DocumentFile [ ] ,
14
17
config : ValidationSchemaPluginConfig
15
- ) : Types . PluginOutput => {
18
+ ) : Types . ComplexPluginOutput => {
16
19
const { schema : _schema , ast } = transformSchemaAST ( schema , config ) ;
17
20
const { buildImports, ...visitor } = YupSchemaVisitor ( _schema , config ) ;
18
21
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const YupSchemaVisitor = (
29
29
if ( config . importFrom && importTypes . length > 0 ) {
30
30
return [
31
31
importYup ,
32
- `import { ${ importTypes . join ( ", " ) } } from " ${ config . importFrom } "; ` ,
32
+ `import { ${ importTypes . join ( ", " ) } } from ' ${ config . importFrom } ' ` ,
33
33
] ;
34
34
}
35
35
return [ importYup ] ;
@@ -64,7 +64,7 @@ export const YupSchemaVisitor = (
64
64
. withContent (
65
65
`yup.mixed().oneOf([${ node . values
66
66
?. map (
67
- ( enumOption ) => `'${ tsVisitor . convertName ( enumOption . name ) } '`
67
+ ( enumOption ) => `'${ enumOption . name . value } '`
68
68
)
69
69
. join ( ", " ) } ])`
70
70
) . string ;
You can’t perform that action at this time.
0 commit comments