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

Method fetchInfiniteQuery

packages/query-core/src/queryClient.ts:764–782  ·  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

762 * @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.
763 */
764 fetchInfiniteQuery<
765 TQueryFnData,
766 TError = DefaultError,
767 TData = TQueryFnData,
768 TQueryKey extends QueryKey = QueryKey,
769 TPageParam = unknown,
770 >(
771 options: FetchInfiniteQueryOptions<
772 TQueryFnData,
773 TError,
774 TData,
775 TQueryKey,
776 TPageParam
777 >,
778 ): Promise<InfiniteData<TData, TPageParam>> {
779 options._type = 'infinite'
780 // oxlint-disable-next-line tanstack-query/no-restricted-syntax
781 return this.fetchQuery(options as any)
782 }
783
784 /**
785 * 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