File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export const YupSchemaVisitor = (
35
35
return [ importYup ] ;
36
36
} ,
37
37
InputObjectTypeDefinition : ( node : InputObjectTypeDefinitionNode ) => {
38
- const name = node . name . value ;
38
+ const name = tsVisitor . convertName ( node . name . value ) ;
39
39
importTypes . push ( name ) ;
40
40
41
41
const shape = node . fields
@@ -53,7 +53,7 @@ export const YupSchemaVisitor = (
53
53
) . string ;
54
54
} ,
55
55
EnumTypeDefinition : ( node : EnumTypeDefinitionNode ) => {
56
- const enumname = node . name . value ;
56
+ const enumname = tsVisitor . convertName ( node . name . value ) ;
57
57
importTypes . push ( enumname ) ;
58
58
59
59
if ( config . enumsAsTypes ) {
@@ -161,12 +161,12 @@ const generateNameNodeYupSchema = (
161
161
const typ = schema . getType ( node . value ) ;
162
162
163
163
if ( typ && typ . astNode ?. kind === "InputObjectTypeDefinition" ) {
164
- const enumName = typ . astNode . name . value ;
164
+ const enumName = tsVisitor . convertName ( typ . astNode . name . value ) ;
165
165
return `${ enumName } Schema()` ;
166
166
}
167
167
168
168
if ( typ && typ . astNode ?. kind === "EnumTypeDefinition" ) {
169
- const enumName = typ . astNode . name . value ;
169
+ const enumName = tsVisitor . convertName ( typ . astNode . name . value ) ;
170
170
return `${ enumName } Schema` ;
171
171
}
172
172
Original file line number Diff line number Diff line change @@ -60,4 +60,15 @@ input EventArgumentInput {
60
60
value : String !
61
61
}
62
62
63
- scalar Date
63
+ input HTTPInput {
64
+ method : HTTPMethod
65
+ url : URL !
66
+ }
67
+
68
+ enum HTTPMethod {
69
+ GET
70
+ POST
71
+ }
72
+
73
+ scalar Date
74
+ scalar URL
You can’t perform that action at this time.
0 commit comments