-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hi,
Using RTK Query and defining an api through api.injectEndpoints i tried to transformResponse on query but i have a trouble with the third arguments typings.
const localizationApi = api.injectEndpoints({
searchLocations: builder.query<
Place[] | Country[] | (Place|Country)[],
{ searchTerms: string; type?: LocationType; placeType?: PlaceType }
>({
query: ({ searchTerms }) => ({
url: ...,
params: { input: searchTerms },
}),
transformResponse: (response: Place[] | Country[] | (Place|Country)[], meta, arg) => {
console.log(arg)
// trouble here with arg
return response as Place[] | Country[] | (Place|Country)[]
},
}),})So when i look at the console.log(arg) i can see this object :
but in editor (vscode) i see arg typed as follow :
There should be a missing type around the args provide by user.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

