Skip to content

streamedQuery does not work with useInfiniteQuery #8866

@lukedukeus

Description

@lukedukeus

Describe the bug

streamedQuery does not work with useInfiniteQuery.

streamedQuery returns QueryFunction<Array<TQueryFnData>, TQueryKey>, but useInfinitQuery expects a queryFn with type QueryFunction<TQueryFnData, TQueryKey, TPageParam> | SkipToken

If this is by design, or there is some logical reason why this shouldn't be possible feel free to convert it to a discussion

Steps to reproduce

const query = useInfiniteQuery({
  queryKey: ['data'],
  queryFn: streamedQuery({
    queryFn: fetchDataInChunks,
  }),
})

Expected behavior

I would expect to useInfiniteQuery, and new data from a streamed query is automatically added to the last page of results that useInfiniteQuery returns.

Tanstack Query adapter

react-query

TanStack Query version

v5.69.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions