* Synchronous way to immediately update the cached data of multiple queries at once, using * filters or partial query key matching. Only queries that already exist and match the given * filters are updated; no new cache entries are created. Internally this calls * {@link QueryClient#setQuer
(
filters: TQueryFilters,
updater: Updater<
NoInfer<TQueryFnData> | undefined,
NoInfer<TQueryFnData> | undefined
>,
options?: SetDataOptions,
)
| 337 | * ``` |
| 338 | */ |
| 339 | setQueriesData< |
| 340 | TQueryFnData, |
| 341 | TQueryFilters extends QueryFilters<any> = QueryFilters, |
| 342 | >( |
| 343 | filters: TQueryFilters, |
| 344 | updater: Updater< |
| 345 | NoInfer<TQueryFnData> | undefined, |
| 346 | NoInfer<TQueryFnData> | undefined |
| 347 | >, |
| 348 | options?: SetDataOptions, |
| 349 | ): Array<[QueryKey, TQueryFnData | undefined]> { |
| 350 | return notifyManager.batch(() => |
| 351 | this.#queryCache |
| 352 | .findAll(filters) |
| 353 | .map(({ queryKey }) => [ |
| 354 | queryKey, |
| 355 | this.setQueryData<TQueryFnData>(queryKey, updater, options), |
| 356 | ]), |
| 357 | ) |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Imperative (non-reactive) way to retrieve an existing query's state. If the query does not |
no test coverage detected