* Fetches the observed query and updates the result once the fetch settles. Used by `refetch` and, * in `InfiniteQueryObserver`, to fetch more pages. * @param fetchOptions - Options for this fetch. `cancelRefetch` defaults to `true`. * @returns A promise that resolves with the updated resul
(
fetchOptions: ObserverFetchOptions,
)
| 469 | * @returns A promise that resolves with the updated result. |
| 470 | */ |
| 471 | protected fetch( |
| 472 | fetchOptions: ObserverFetchOptions, |
| 473 | ): Promise<QueryObserverResult<TData, TError>> { |
| 474 | return this.#executeFetch({ |
| 475 | ...fetchOptions, |
| 476 | cancelRefetch: fetchOptions.cancelRefetch ?? true, |
| 477 | }).then(() => { |
| 478 | this.updateResult() |
| 479 | return this.#currentResult |
| 480 | }) |
| 481 | } |
| 482 | |
| 483 | #executeFetch( |
| 484 | fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>, |
no test coverage detected