MCPcopy Create free account
hub / github.com/TanStack/query / #executeFetch

Method #executeFetch

packages/query-core/src/queryObserver.ts:482–499  ·  view source on GitHub ↗
(
    fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,
  )

Source from the content-addressed store, hash-verified

480 }
481
482 #executeFetch(
483 fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,
484 ): Promise<TQueryData | undefined> {
485 // Make sure we reference the latest query as the current one might have been removed
486 this.#updateQuery()
487
488 // Fetch
489 let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(
490 this.options,
491 fetchOptions,
492 )
493
494 if (!fetchOptions?.throwOnError) {
495 promise = promise.catch(noop)
496 }
497
498 return promise
499 }
500
501 #shouldScheduleTimer(timeout: unknown): timeout is number {
502 return (

Callers 4

onSubscribeMethod · 0.95
setOptionsMethod · 0.95
fetchMethod · 0.95

Calls 2

#updateQueryMethod · 0.95
fetchMethod · 0.45

Tested by

no test coverage detected