MCPcopy Create free account
hub / github.com/TanStack/query / fetchInfiniteQuery

Method fetchInfiniteQuery

packages/query-core/src/queryClient.ts:760–778  ·  view source on GitHub ↗

* Fetches and caches an infinite query, or returns its cached data if it isn't stale. * @param options - The infinite query options, including `initialPageParam` and `getNextPageParam`. * @returns A promise that resolves to the cached or fetched InfiniteData, or rejects with * the f

(
    options: FetchInfiniteQueryOptions<
      TQueryFnData,
      TError,
      TData,
      TQueryKey,
      TPageParam
    >,
  )

Source from the content-addressed store, hash-verified

758 * @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.
759 */
760 fetchInfiniteQuery<
761 TQueryFnData,
762 TError = DefaultError,
763 TData = TQueryFnData,
764 TQueryKey extends QueryKey = QueryKey,
765 TPageParam = unknown,
766 >(
767 options: FetchInfiniteQueryOptions<
768 TQueryFnData,
769 TError,
770 TData,
771 TQueryKey,
772 TPageParam
773 >,
774 ): Promise<InfiniteData<TData, TPageParam>> {
775 options._type = 'infinite'
776 // oxlint-disable-next-line tanstack-query/no-restricted-syntax
777 return this.fetchQuery(options as any)
778 }
779
780 /**
781 * Fetches and caches an infinite query like {@link QueryClient#fetchInfiniteQuery}, but ignores

Callers 9

prefetchInfiniteQueryMethod · 0.95
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 1

fetchQueryMethod · 0.95

Tested by

no test coverage detected