@@ -213,13 +213,24 @@ describe('composeWithJson', () => {
213
213
name : 'Luke Skywalker' ,
214
214
limbs : [
215
215
{ kind : 'arm' , position : 'left' , length : 76 } ,
216
- { kind : 'arm' , position : 'left ' , length : 76 } ,
217
- { kind : 'leg' , position : 'left' , length : 81 } ,
218
- { kind : 'leg' , position : 'right' , length : 82 } ,
216
+ { kind : 'arm' , position : 'right ' , length : 76 , ring : true } ,
217
+ { kind : 'leg' , position : 'left' , length : 81 , sock : 'red' } ,
218
+ { kind : 'leg' , position : 'right' , length : 82 , sock : 'red' } ,
219
219
] ,
220
220
} ;
221
221
222
222
const PersonTC = composeWithJson ( 'PersonCustom' , restApiResponse ) ;
223
+ expect (
224
+ PersonTC . getFieldTC ( 'limbs' )
225
+ . getFieldTC ( 'ring' )
226
+ . getTypeName ( )
227
+ ) . toEqual ( 'Boolean' ) ;
228
+ expect (
229
+ PersonTC . getFieldTC ( 'limbs' )
230
+ . getFieldTC ( 'sock' )
231
+ . getTypeName ( )
232
+ ) . toEqual ( 'String' ) ;
233
+
223
234
const schema1 = new GraphQLSchema ( {
224
235
query : new GraphQLObjectType ( {
225
236
name : 'Query' ,
@@ -241,6 +252,7 @@ describe('composeWithJson', () => {
241
252
name
242
253
limbs {
243
254
length
255
+ ring
244
256
}
245
257
}
246
258
}`
@@ -250,7 +262,12 @@ describe('composeWithJson', () => {
250
262
data : {
251
263
person : {
252
264
name : 'Luke Skywalker' ,
253
- limbs : [ { length : 76 } , { length : 76 } , { length : 81 } , { length : 82 } ] ,
265
+ limbs : [
266
+ { length : 76 , ring : null } ,
267
+ { length : 76 , ring : true } ,
268
+ { length : 81 , ring : null } ,
269
+ { length : 82 , ring : null } ,
270
+ ] ,
254
271
} ,
255
272
} ,
256
273
} ) ;
0 commit comments