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 {
88} from "@graphql-codegen/plugin-helpers" ;
99import { GraphQLSchema } from "graphql" ;
1010
11- export const plugin : PluginFunction < ValidationSchemaPluginConfig > = (
11+ export const plugin : PluginFunction <
12+ ValidationSchemaPluginConfig ,
13+ Types . ComplexPluginOutput
14+ > = (
1215 schema : GraphQLSchema ,
1316 _documents : Types . DocumentFile [ ] ,
1417 config : ValidationSchemaPluginConfig
15- ) : Types . PluginOutput => {
18+ ) : Types . ComplexPluginOutput => {
1619 const { schema : _schema , ast } = transformSchemaAST ( schema , config ) ;
1720 const { buildImports, ...visitor } = YupSchemaVisitor ( _schema , config ) ;
1821
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const YupSchemaVisitor = (
2929 if ( config . importFrom && importTypes . length > 0 ) {
3030 return [
3131 importYup ,
32- `import { ${ importTypes . join ( ", " ) } } from " ${ config . importFrom } "; ` ,
32+ `import { ${ importTypes . join ( ", " ) } } from ' ${ config . importFrom } ' ` ,
3333 ] ;
3434 }
3535 return [ importYup ] ;
@@ -64,7 +64,7 @@ export const YupSchemaVisitor = (
6464 . withContent (
6565 `yup.mixed().oneOf([${ node . values
6666 ?. map (
67- ( enumOption ) => `'${ tsVisitor . convertName ( enumOption . name ) } '`
67+ ( enumOption ) => `'${ enumOption . name . value } '`
6868 )
6969 . join ( ", " ) } ])`
7070 ) . string ;
You can’t perform that action at this time.
0 commit comments