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

Method setQueriesData

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

Source from the content-addressed store, hash-verified

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