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

Method #executeFetch

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

Source from the content-addressed store, hash-verified

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