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

Method fetch

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

Source from the content-addressed store, hash-verified

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