File tree 1 file changed +15
-0
lines changed
packages/toolkit/src/query/tests
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -474,13 +474,28 @@ describe('type tests', () => {
474
474
query : ( { id } : { id : number } ) => `/post/${ id } ` ,
475
475
responseSchema : postSchema ,
476
476
} ) ,
477
+ query2 : build . query ( {
478
+ query : ( arg ) => {
479
+ expectTypeOf ( arg ) . toEqualTypeOf < { id : number } > ( )
480
+ return `/post/${ arg . id } `
481
+ } ,
482
+ argSchema,
483
+ responseSchema : postSchema ,
484
+ } ) ,
477
485
} ) ,
478
486
} )
479
487
480
488
expectTypeOf ( api . endpoints . query . Types . QueryArg ) . toEqualTypeOf < {
481
489
id : number
482
490
} > ( )
483
491
expectTypeOf ( api . endpoints . query . Types . ResultType ) . toEqualTypeOf < Post > ( )
492
+
493
+ expectTypeOf ( api . endpoints . query2 . Types . QueryArg ) . toEqualTypeOf < {
494
+ id : number
495
+ } > ( )
496
+ expectTypeOf (
497
+ api . endpoints . query2 . Types . ResultType ,
498
+ ) . toEqualTypeOf < Post > ( )
484
499
} )
485
500
} )
486
501
} )
You can’t perform that action at this time.
0 commit comments