MCPcopy
hub / github.com/TanStack/query / #executeFetch

Method #executeFetch

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

Source from the content-addressed store, hash-verified

332 }
333
334 #executeFetch(
335 fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,
336 ): Promise<TQueryData | undefined> {
337 // Make sure we reference the latest query as the current one might have been removed
338 this.#updateQuery()
339
340 // Fetch
341 let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(
342 this.options as QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey>,
343 fetchOptions,
344 )
345
346 if (!fetchOptions?.throwOnError) {
347 promise = promise.catch(noop)
348 }
349
350 return promise
351 }
352
353 #updateStaleTimeout(): void {
354 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