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

Method fetch

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

Source from the content-addressed store, hash-verified

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