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

Method prefetchQuery

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

* @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.

(
    options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
  )

Source from the content-addressed store, hash-verified

424 * @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
425 */
426 prefetchQuery<
427 TQueryFnData = unknown,
428 TError = DefaultError,
429 TData = TQueryFnData,
430 TQueryKey extends QueryKey = QueryKey,
431 >(
432 options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
433 ): Promise<void> {
434 return this.fetchQuery(options).then(noop).catch(noop)
435 }
436
437 infiniteQuery<
438 TQueryFnData,

Callers 15

ensureQueryDataMethod · 0.95
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
Devtools.test.tsxFile · 0.45

Calls 1

fetchQueryMethod · 0.95

Tested by

no test coverage detected