@@ -64,16 +64,14 @@ describe('composeWithRelay', () => {
64
64
it ( 'should has ConnectionType as type' , ( ) => {
65
65
expect ( type ) . toBeTruthy ( ) ;
66
66
expect ( tc . getFieldNames ( ) ) . toEqual ( expect . arrayContaining ( [ 'count' , 'pageInfo' , 'edges' ] ) ) ;
67
- expect ( tc . getFieldType ( 'edges' ) ) . toBeInstanceOf ( GraphQLNonNull ) ;
68
- expect ( tc . getFieldType ( 'edges' ) . ofType ) . toBeInstanceOf ( GraphQLList ) ;
67
+ const edgesType : any = tc . getFieldType ( 'edges' ) ;
68
+ expect ( edgesType ) . toBeInstanceOf ( GraphQLNonNull ) ;
69
+ expect ( edgesType . ofType ) . toBeInstanceOf ( GraphQLList ) ;
69
70
} ) ;
70
71
} ) ;
71
72
72
73
it ( 'should apply first sort ID_ASC by default' , async ( ) => {
73
- rootQueryTC . setField (
74
- 'userConnection' ,
75
- userTypeComposer . getResolver ( 'connection' ) . getFieldConfig ( )
76
- ) ;
74
+ rootQueryTC . setField ( 'userConnection' , userTypeComposer . getResolver ( 'connection' ) ) ;
77
75
const schema = new GraphQLSchema ( {
78
76
query : rootQueryTC . getType ( ) ,
79
77
} ) ;
@@ -123,10 +121,7 @@ describe('composeWithRelay', () => {
123
121
} ) ;
124
122
125
123
it ( 'should able to change `sort` on AGE_ID_DESC' , async ( ) => {
126
- rootQueryTC . setField (
127
- 'userConnection' ,
128
- userTypeComposer . getResolver ( 'connection' ) . getFieldConfig ( )
129
- ) ;
124
+ rootQueryTC . setField ( 'userConnection' , userTypeComposer . getResolver ( 'connection' ) ) ;
130
125
const schema = new GraphQLSchema ( {
131
126
query : rootQueryTC . getType ( ) ,
132
127
} ) ;
@@ -178,10 +173,7 @@ describe('composeWithRelay', () => {
178
173
179
174
describe ( 'fragments fields projection of graphql-compose' , ( ) => {
180
175
it ( 'should return object' , async ( ) => {
181
- rootQueryTC . setField (
182
- 'userConnection' ,
183
- userTypeComposer . getResolver ( 'connection' ) . getFieldConfig ( )
184
- ) ;
176
+ rootQueryTC . setField ( 'userConnection' , userTypeComposer . getResolver ( 'connection' ) ) ;
185
177
const schema = new GraphQLSchema ( {
186
178
query : rootQueryTC . getType ( ) ,
187
179
} ) ;
@@ -246,14 +238,11 @@ describe('composeWithRelay', () => {
246
238
247
239
rootQueryTC . setField (
248
240
'userConnection' ,
249
- userTypeComposer
250
- . getResolver ( 'connection' )
251
- . wrapResolve ( next => rp => {
252
- const result = next ( rp ) ;
253
- topResolveParams = rp ;
254
- return result ;
255
- } )
256
- . getFieldConfig ( )
241
+ userTypeComposer . getResolver ( 'connection' ) . wrapResolve ( next => rp => {
242
+ const result = next ( rp ) ;
243
+ topResolveParams = rp ;
244
+ return result ;
245
+ } )
257
246
) ;
258
247
const schema = new GraphQLSchema ( {
259
248
query : rootQueryTC . getType ( ) ,
@@ -279,14 +268,11 @@ describe('composeWithRelay', () => {
279
268
280
269
rootQueryTC . setField (
281
270
'userConnection' ,
282
- userTypeComposer
283
- . getResolver ( 'connection' )
284
- . wrapResolve ( next => rp => {
285
- const result = next ( rp ) ;
286
- topResolveParams = rp ;
287
- return result ;
288
- } )
289
- . getFieldConfig ( )
271
+ userTypeComposer . getResolver ( 'connection' ) . wrapResolve ( next => rp => {
272
+ const result = next ( rp ) ;
273
+ topResolveParams = rp ;
274
+ return result ;
275
+ } )
290
276
) ;
291
277
const schema = new GraphQLSchema ( {
292
278
query : rootQueryTC . getType ( ) ,
0 commit comments