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

Method prefetchInfiniteQuery

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

789 * @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
790 */
791 prefetchInfiniteQuery<
792 TQueryFnData,
793 TError = DefaultError,
794 TData = TQueryFnData,
795 TQueryKey extends QueryKey = QueryKey,
796 TPageParam = unknown,
797 >(
798 options: FetchInfiniteQueryOptions<
799 TQueryFnData,
800 TError,
801 TData,
802 TQueryKey,
803 TPageParam
804 >,
805 ): Promise<void> {
806 // oxlint-disable-next-line tanstack-query/no-restricted-syntax
807 return this.fetchInfiniteQuery(options).then(noop).catch(noop)
808 }
809
810 /**
811 * 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