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

Method infiniteQuery

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

724 * ```
725 */
726 infiniteQuery<
727 TQueryFnData,
728 TError = DefaultError,
729 TData = InfiniteData<TQueryFnData>,
730 TQueryKey extends QueryKey = QueryKey,
731 TPageParam = unknown,
732 >(
733 options: InfiniteQueryExecuteOptions<
734 TQueryFnData,
735 TError,
736 TData,
737 TQueryKey,
738 TPageParam
739 >,
740 ): Promise<
741 Array<TData> extends Array<InfiniteData<TQueryFnData>>
742 ? InfiniteData<TQueryFnData, TPageParam>
743 : TData
744 > {
745 options._type = 'infinite'
746 return this.query(options as any)
747 }
748
749 /**
750 * Fetches and caches an infinite query, or returns its cached data if it isn't stale.

Calls 1

queryMethod · 0.95

Tested by

no test coverage detected