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

Method fetch

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

Source from the content-addressed store, hash-verified

339 }
340
341 protected fetch(
342 fetchOptions: ObserverFetchOptions,
343 ): Promise<QueryObserverResult<TData, TError>> {
344 return this.#executeFetch({
345 ...fetchOptions,
346 cancelRefetch: fetchOptions.cancelRefetch ?? true,
347 }).then(() => {
348 this.updateResult()
349 return this.#currentResult
350 })
351 }
352
353 #executeFetch(
354 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