File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ public function testNormalCreatingParams()
120
120
$ this ->assertEquals ($ enumType ->getNamedType (), $ enumType );
121
121
122
122
$ this ->assertFalse ($ enumType ->isValidValue ($ enumType ));
123
- $ this ->assertFalse ($ enumType ->isValidValue (null ));
123
+ $ this ->assertTrue ($ enumType ->isValidValue (null ));
124
124
125
125
$ this ->assertTrue ($ enumType ->isValidValue (true ));
126
126
$ this ->assertTrue ($ enumType ->isValidValue ('disable ' ));
Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ public function testDefaultEnum()
91
91
$ result = $ processor ->getResponseData ();
92
92
93
93
$ this ->assertEquals (['data ' => [
94
- 'enumObject ' => null
94
+ 'enumObject ' => [
95
+ 'status ' => null
96
+ ]
95
97
]], $ result );
96
98
}
97
99
Original file line number Diff line number Diff line change @@ -180,6 +180,12 @@ const blogSchema = new GraphQLSchema({
180
180
return [ DataProvider . getPost ( 2 ) , DataProvider . getBanner ( 3 ) ] ;
181
181
}
182
182
} ,
183
+ enumNull : {
184
+ type : postStatus ,
185
+ resolve : ( ) => {
186
+ return null ;
187
+ }
188
+ } ,
183
189
scalarList : {
184
190
type : new GraphQLList ( new GraphQLObjectType ( {
185
191
name : 'scalarObject' ,
@@ -224,7 +230,7 @@ const blogSchema = new GraphQLSchema({
224
230
} )
225
231
} ) ;
226
232
227
- var query = '{ scalarList(count: 12) { id, cost } }' ;
233
+ var query = '{ enumNull }' ;
228
234
graphql ( blogSchema , query ) . then ( result => {
229
235
console . log ( JSON . stringify ( result , null , 5 ) ) ;
230
236
process . exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments