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

Method #executeFetch

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

Source from the content-addressed store, hash-verified

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