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

Method infiniteQuery

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

* Asynchronous method to fetch and cache an infinite query, resolving with an * InfiniteData object or throwing with the error. * * Behaves like QueryClient#query, accepting the same options (minus * `initialPageParam`), plus the required `initialPageParam`, and an option

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

Source from the content-addressed store, hash-verified

667 * ```
668 */
669 infiniteQuery<
670 TQueryFnData,
671 TError = DefaultError,
672 TData = InfiniteData<TQueryFnData>,
673 TQueryKey extends QueryKey = QueryKey,
674 TPageParam = unknown,
675 >(
676 options: InfiniteQueryExecuteOptions<
677 TQueryFnData,
678 TError,
679 TData,
680 TQueryKey,
681 TPageParam
682 >,
683 ): Promise<
684 Array<TData> extends Array<InfiniteData<TQueryFnData>>
685 ? InfiniteData<TQueryFnData, TPageParam>
686 : TData
687 > {
688 options._type = 'infinite'
689 return this.query(options as any)
690 }
691
692 /**
693 * @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.

Callers 3

hydration.test.tsxFile · 0.45

Calls 1

queryMethod · 0.95

Tested by

no test coverage detected