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

Method prefetchInfiniteQuery

packages/query-core/src/queryClient.ts:785–802  ·  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 the `queryKey`, the `queryFn`, and the * `initialPageParam`. * @returns A promise that resolves once the fe

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

Source from the content-addressed store, hash-verified

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