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

Method #executeFetch

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

Source from the content-addressed store, hash-verified

351 }
352
353 #executeFetch(
354 fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,
355 ): Promise<TQueryData | undefined> {
356 // Make sure we reference the latest query as the current one might have been removed
357 this.#updateQuery()
358
359 // Fetch
360 let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(
361 this.options,
362 fetchOptions,
363 )
364
365 if (!fetchOptions?.throwOnError) {
366 promise = promise.catch(noop)
367 }
368
369 return promise
370 }
371
372 #updateStaleTimeout(): void {
373 this.#clearStaleTimeout()

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