MCPcopy Create free account
hub / github.com/effect-app/libs / makeTanstackQueryCacheUpdater

Function makeTanstackQueryCacheUpdater

packages/vue/src/internal/tanstackQuery.ts:123–137  ·  view source on GitHub ↗
(queryClient: QueryClient)

Source from the content-addressed store, hash-verified

121 yield* Effect.forEach(
122 keys,
123 (queryKey) => Effect.promise(() => queryClient.invalidateQueries({ queryKey }, { updateMeta: { span } })),
124 { discard: true, concurrency: "unbounded" }
125 )
126 })
127 .pipe(Effect.orDie)
128})
129
130const fullQueryKey = (
131 q: { readonly queryKeyProjectionHash?: string },
132 queryKey: ReadonlyArray<unknown>,
133 input: unknown
134) => q.queryKeyProjectionHash === undefined ? [...queryKey, input] : [...queryKey, q.queryKeyProjectionHash, input]
135
136export const makeTanstackQueryCacheUpdater = (queryClient: QueryClient): QueryCacheUpdater => ({
137 update: <I, A, E, R, Request extends Req, Name extends string>(
138 _registry: ReturnType<typeof injectRegistry>,
139 query: RequestHandlerWithInput<I, A, E, R, Request, Name>,
140 input: I,

Callers 1

makeClientFunction · 0.90

Calls 3

makeQueryKeyFunction · 0.90
fullQueryKeyFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…