* Fetches and caches a query like QueryClient#fetchQuery, but ignores the result and any * error. * @param options - The query options, including the `queryKey` and the `queryFn` used if the * query needs to fetch. * @returns A promise that resolves once the fetch settles. It nev
(
options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
)
| 688 | * @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version. |
| 689 | */ |
| 690 | prefetchQuery< |
| 691 | TQueryFnData = unknown, |
| 692 | TError = DefaultError, |
| 693 | TData = TQueryFnData, |
| 694 | TQueryKey extends QueryKey = QueryKey, |
| 695 | >( |
| 696 | options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>, |
| 697 | ): Promise<void> { |
| 698 | // oxlint-disable-next-line tanstack-query/no-restricted-syntax |
| 699 | return this.fetchQuery(options).then(noop).catch(noop) |
| 700 | } |
| 701 | |
| 702 | /** |
| 703 | * Asynchronous method to fetch and cache an infinite query, resolving with an |
no test coverage detected