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

Method fetchInfiniteQuery

packages/query-core/src/queryClient.ts:757–775  ·  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 the `queryKey`, the `queryFn`, and the * `initialPageParam`. * @returns A promise that resolves to the cached or fetched InfiniteData, or re

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

Source from the content-addressed store, hash-verified

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