openapi-react-query version
0.3.1
Description
useInfiniteQuery does not infer the type from the select option the same way useQuery does. See #2105.
Reproduction
$api.useInfiniteQuery(
'post',
'/api/v1/events',
{},
{
select: (data) => data.pages.flatMap((page) => page.data),
}
)
Produces this error:
Type '(data: InfiniteData<{ data: { id: string }[]; }, unknown>) => { ...; }[]' is not assignable to type '(data: InfiniteData<{ data: { id: string; }[]; }, unknown>) => InfiniteData<...>'.
Expected result
The select type should infer the type for data exactly as useQuery would.
Extra
openapi-react-query version
0.3.1
Description
useInfiniteQuerydoes not infer the type from theselectoption the same wayuseQuerydoes. See #2105.Reproduction
Produces this error:
Expected result
The select type should infer the type for
dataexactly asuseQuerywould.Extra