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

Method refetch

packages/query-core/src/queryObserver.ts:371–377  ·  view source on GitHub ↗

* Refetches the observed query and returns a promise that resolves with * the resulting `QueryObserverResult`. * * @example * ```ts * const result = await observer.refetch({ cancelRefetch: false }) * console.log(result.data) * ```

({ ...options }: RefetchOptions = {})

Source from the content-addressed store, hash-verified

369 * ```
370 */
371 refetch({ ...options }: RefetchOptions = {}): Promise<
372 QueryObserverResult<TData, TError>
373 > {
374 return this.fetch({
375 ...options,
376 })
377 }
378
379 /**
380 * Fetches a query defined by the given options without affecting this

Callers 15

QueryControllerClass · 0.80
refetchFunction · 0.80
getOptimisticResultFunction · 0.80
useQuery.test.tsFile · 0.80
useQueries.test.tsFile · 0.80
PageFunction · 0.80
PageFunction · 0.80

Calls 1

fetchMethod · 0.95

Tested by 11

PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
PageFunction · 0.64
FirstComponentFunction · 0.64