MCPcopy Create free account
hub / github.com/TanStack/query / fetch

Method fetch

packages/query-core/src/queryObserver.ts:448–458  ·  view source on GitHub ↗
(
    fetchOptions: ObserverFetchOptions,
  )

Source from the content-addressed store, hash-verified

446 }
447
448 protected fetch(
449 fetchOptions: ObserverFetchOptions,
450 ): Promise<QueryObserverResult<TData, TError>> {
451 return this.#executeFetch({
452 ...fetchOptions,
453 cancelRefetch: fetchOptions.cancelRefetch ?? true,
454 }).then(() => {
455 this.updateResult()
456 return this.#currentResult
457 })
458 }
459
460 #executeFetch(
461 fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,

Callers 3

refetchMethod · 0.95
fetchOptimisticMethod · 0.45
#executeFetchMethod · 0.45

Calls 2

#executeFetchMethod · 0.95
updateResultMethod · 0.95

Tested by

no test coverage detected