File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/toolkit/src/query/tests Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -474,13 +474,28 @@ describe('type tests', () => {
474474 query : ( { id } : { id : number } ) => `/post/${ id } ` ,
475475 responseSchema : postSchema ,
476476 } ) ,
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+ } ) ,
477485 } ) ,
478486 } )
479487
480488 expectTypeOf ( api . endpoints . query . Types . QueryArg ) . toEqualTypeOf < {
481489 id : number
482490 } > ( )
483491 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 > ( )
484499 } )
485500 } )
486501 } )
You can’t perform that action at this time.
0 commit comments