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

Method getQueriesData

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

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