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

Method prefetchInfiniteQuery

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

* Fetches and caches an infinite query like QueryClient#fetchInfiniteQuery, but ignores * the result and any error. * @param options - The infinite query options, including `initialPageParam` and `getNextPageParam`. * @returns A promise that resolves once the fetch settles. It never

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

Source from the content-addressed store, hash-verified

785 * @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
786 */
787 prefetchInfiniteQuery<
788 TQueryFnData,
789 TError = DefaultError,
790 TData = TQueryFnData,
791 TQueryKey extends QueryKey = QueryKey,
792 TPageParam = unknown,
793 >(
794 options: FetchInfiniteQueryOptions<
795 TQueryFnData,
796 TError,
797 TData,
798 TQueryKey,
799 TPageParam
800 >,
801 ): Promise<void> {
802 // oxlint-disable-next-line tanstack-query/no-restricted-syntax
803 return this.fetchInfiniteQuery(options).then(noop).catch(noop)
804 }
805
806 /**
807 * Returns the cached data of an infinite query, or fetches it if there is none. With

Callers 8

ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 1

fetchInfiniteQueryMethod · 0.95

Tested by

no test coverage detected