Open
Description
Describe the bug
injectQuery
and injectMutation
support type narrowing via the is* status signals.
This was not implemented for injectInfiniteQuery
Your minimal, reproducible example
Steps to reproduce
On linked TS playground:
const infiniteQuery = injectInfiniteQuery(() => ({
queryKey: ["projects"],
queryFn: ({ pageParam }) => {
return Promise.resolve(5);
},
initialPageParam: 2,
getPreviousPageParam: (firstPage) => 1,
getNextPageParam: (lastPage) => 3,
}));
if (infiniteQuery.isSuccess()) {
// ❌ after checking isSuccess data signal still possibly undefined
const data = infiniteQuery.data();
}
Expected behavior
Type narrowing should work for infinite queries on Angular too
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
N/A
Tanstack Query adapter
angular-query
TanStack Query version
v5.72.3
TypeScript version
No response
Additional context
No response