MCPcopy
hub / github.com/TanStack/query / setQueriesData

Method setQueriesData

packages/query-core/src/queryClient.ts:211–230  ·  view source on GitHub ↗
(
    filters: TQueryFilters,
    updater: Updater<
      NoInfer<TQueryFnData> | undefined,
      NoInfer<TQueryFnData> | undefined
    >,
    options?: SetDataOptions,
  )

Source from the content-addressed store, hash-verified

209 }
210
211 setQueriesData<
212 TQueryFnData,
213 TQueryFilters extends QueryFilters<any> = QueryFilters,
214 >(
215 filters: TQueryFilters,
216 updater: Updater<
217 NoInfer<TQueryFnData> | undefined,
218 NoInfer<TQueryFnData> | undefined
219 >,
220 options?: SetDataOptions,
221 ): Array<[QueryKey, TQueryFnData | undefined]> {
222 return notifyManager.batch(() =>
223 this.#queryCache
224 .findAll(filters)
225 .map(({ queryKey }) => [
226 queryKey,
227 this.setQueryData<TQueryFnData>(queryKey, updater, options),
228 ]),
229 )
230 }
231
232 getQueryState<
233 TQueryFnData = unknown,

Callers 10

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

Calls 2

setQueryDataMethod · 0.95
findAllMethod · 0.45

Tested by

no test coverage detected