diff --git a/packages/toolkit/src/query/react/buildHooks.ts b/packages/toolkit/src/query/react/buildHooks.ts index 403a4e57bc..e3d9bfef72 100644 --- a/packages/toolkit/src/query/react/buildHooks.ts +++ b/packages/toolkit/src/query/react/buildHooks.ts @@ -1562,7 +1562,9 @@ export function buildHooks({ skipPollingIfUnfocused = false, } = {}, ) => { - const { initiate } = api.endpoints[name] as ApiEndpointInfiniteQuery< + const { initiate } = api.endpoints[ + name + ] as unknown as ApiEndpointInfiniteQuery< InfiniteQueryDefinition, Definitions > @@ -1725,7 +1727,7 @@ export function buildHooks({ ) => { const { select, initiate } = api.endpoints[ name - ] as ApiEndpointInfiniteQuery< + ] as unknown as ApiEndpointInfiniteQuery< InfiniteQueryDefinition, Definitions >