MCPcopy
hub / github.com/TanStack/query / fetch

Method fetch

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

Source from the content-addressed store, hash-verified

320 }
321
322 protected fetch(
323 fetchOptions: ObserverFetchOptions,
324 ): Promise<QueryObserverResult<TData, TError>> {
325 return this.#executeFetch({
326 ...fetchOptions,
327 cancelRefetch: fetchOptions.cancelRefetch ?? true,
328 }).then(() => {
329 this.updateResult()
330 return this.#currentResult
331 })
332 }
333
334 #executeFetch(
335 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