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

Method #executeFetch

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

Source from the content-addressed store, hash-verified

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