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

Method getQueriesData

packages/query-core/src/queryClient.ts:254–262  ·  view source on GitHub ↗

* Imperative (non-reactive) way to retrieve the cached data of multiple queries at once. * Only queries matching the given filters are returned; if none match, an empty array is * returned. * * Because the matched queries can hold data of different shapes (e.g. a broad filter can match

(filters: TQueryFilters)

Source from the content-addressed store, hash-verified

252 * ```
253 */
254 getQueriesData<
255 TQueryFnData = unknown,
256 TQueryFilters extends QueryFilters<any> = QueryFilters,
257 >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {
258 return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
259 const data = state.data as TQueryFnData | undefined
260 return [queryKey, data]
261 })
262 }
263
264 /**
265 * Synchronous way to immediately update a query's cached data. If the updater (or the value

Callers 14

WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected