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

Method #executeFetch

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

Source from the content-addressed store, hash-verified

458 }
459
460 #executeFetch(
461 fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,
462 ): Promise<TQueryData | undefined> {
463 // Make sure we reference the latest query as the current one might have been removed
464 this.#updateQuery()
465
466 // Fetch
467 let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(
468 this.options,
469 fetchOptions,
470 )
471
472 if (!fetchOptions?.throwOnError) {
473 promise = promise.catch(noop)
474 }
475
476 return promise
477 }
478
479 #shouldScheduleTimer(timeout: unknown): timeout is number {
480 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