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

Method getQueriesData

packages/query-core/src/queryClient.ts:242–250  ·  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

240 * ```
241 */
242 getQueriesData<
243 TQueryFnData = unknown,
244 TQueryFilters extends QueryFilters<any> = QueryFilters,
245 >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {
246 return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
247 const data = state.data as TQueryFnData | undefined
248 return [queryKey, data]
249 })
250 }
251
252 /**
253 * 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