Repository navigation
Description
Version: graphifyy 0.9.49 (uv tool install), Python 3.14.4, macOS (arm64)
Summary
Following on from #2524 (which fixed property-assigned function expressions), the JS extractor still misses function-valued exports whose right-hand side is a call expression rather than a function or arrow. The higher-order-function export idiom — exports.name = wrapper(opts, handler) — produces no node, so the exported symbol is invisible to query, path, and explain.
This matters more than the node count suggests, because in frameworks that use this idiom the wrapped exports are usually the module's only externally reachable entry points. Everything the graph does capture is internal helpers.
Repro
const wrap = (f) => f;
function plainFn() {} // captured
const arrowConst = () => {}; // captured
const asyncArrow = async () => {}; // captured
exports.assignedArrow = async (x) => x; // captured (fixed by #2524)
exports.assignedFn = function namedExpr() {}; // captured (fixed by #2524)
module.exports.viaModule = () => {}; // captured (fixed by #2524)
export function esmFn() {} // captured
exports.assignedCall = wrap(async (x) => x); // NOT captured
module.exports = { objectKey: () => {} }; // NOT capturedfrom pathlib import Path
from graphify.extract import extract
r = extract([Path('probe.js')], cache_root=Path('/tmp/probe-cache'))
for n in r['nodes']:
print(n.get('label'), n.get('source_location'))Output — 9 nodes, with assignedCall and objectKey absent:
probe.js L1
wrap() L1
plainFn() L2
arrowConst() L3
asyncArrow() L4
assignedArrow() L6
assignedFn() L7
viaModule() L8
esmFn() L10
Likely cause
A query matching assignment_expression where the RHS is function_expression / arrow_function will not match when the RHS is a call_expression, even though a function literal appears as one of its arguments.
Why it matters
This is the standard shape of several very common frameworks:
// Firebase Functions v2 — every callable in a functions/index.js
exports.myCallable = onCall({ secrets: [KEY] }, async (request) => { ... });
// Express-style middleware wrappers
exports.handler = asyncHandler(async (req, res) => { ... });
// React
export const Card = React.memo((props) => { ... });
export default connect(mapState)(Component);In a Firebase Functions entry module, the effect is that the deployed callables are the only symbols not in the graph — the requires, secret bindings, and private helpers are all captured, but the exported endpoints are not. A client calling one of them by name (e.g. httpsCallable('myCallable')) then has no node to resolve against, so the client and backend appear as disconnected components and cross-boundary path queries return nothing. The graph is not wrong about anything it contains; the entry points are simply missing.
Expected
exports.name = someWrapper(..., fn) and module.exports = { name: fn } captured as nodes under name, consistent with the ids already produced for the #2524 forms. Unwrapping only needs to be one level deep to cover the common cases; the binding name on the left is what callers reference, so the node can be keyed on it without analyzing the wrapper.
Happy to test a branch against a Firebase Functions module and report node counts.
Activity
fix: capture HOF-wrapped CommonJS exports (#3035)
chore: bump to 0.9.50
safishamsi commentedon Aug 25, 2026
Fixed in v0.9.50: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.50. Closing as resolved.