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

Function findQueryClientIdentifiers

packages/query-codemods/src/utils/index.cjs:87–109  ·  view source on GitHub ↗
(importIdentifiers)

Source from the content-addressed store, hash-verified

85 })
86
87 const findQueryClientIdentifiers = (importIdentifiers) =>
88 root
89 .find(jscodeshift.VariableDeclarator, {})
90 .filter((node) => {
91 if (node.value.init) {
92 const initializer = node.value.init
93
94 return (
95 isClassInstantiationOf(
96 initializer,
97 getSelectorByImports(importIdentifiers, 'QueryClient'),
98 ) ||
99 isFunctionCallOf(
100 initializer,
101 getSelectorByImports(importIdentifiers, 'useQueryClient'),
102 )
103 )
104 }
105
106 return false
107 })
108 .paths()
109 .map((node) => node.value.id.name)
110
111 const isCallExpression = (node) =>
112 jscodeshift.match(node, { type: jscodeshift.CallExpression.name })

Callers

nothing calls this directly

Calls 4

isClassInstantiationOfFunction · 0.85
getSelectorByImportsFunction · 0.85
isFunctionCallOfFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…