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

Function defaultGetQueryKey

packages/vue/src/mutate.ts:26–32  ·  view source on GitHub ↗
(h)

Source from the content-addressed store, hash-verified

24 * e.g. `$project/$configuration.get` -> `["$project"]`
25 * e.g. `$project/$configuration/$something.get` -> `["$project","$configuration"]`
26 */
27export const defaultGetQueryKey: GetQueryKey = (h) => {
28 const key = makeQueryKey(h)
29 const ns = key.filter((_) => _.startsWith("$"))
30 const k = ns.length ? ns.length > 1 ? ns.slice(0, ns.length - 1) : ns : undefined
31 if (!k) throw new Error("empty query key for: " + h.id)
32 return k
33}
34
35let activeGetQueryKey: GetQueryKey = defaultGetQueryKey

Callers

nothing calls this directly

Calls 2

makeQueryKeyFunction · 0.90
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…