MCPcopy Create free account
hub / github.com/codemix/graph / runQuery

Function runQuery

packages/graph/src/test/QueryContext.test.ts:114–124  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

112 const steps = astToSteps(ast);
113
114 const runQuery = (name: string) => {
115 return new Promise<unknown[]>((resolve) => {
116 // Simulate async delay to encourage interleaving
117 setTimeout(() => {
118 const context = new QueryContext(graph, { name });
119 const traverser = createTraverser(steps);
120 const results = [...traverser.traverse(graph, [], context)];
121 resolve(results);
122 }, Math.random() * 10);
123 });
124 };
125
126 // Run queries concurrently
127 const [aliceResults, bobResults, charlieResults] = await Promise.all([

Callers 1

Calls 2

createTraverserFunction · 0.85
traverseMethod · 0.45

Tested by

no test coverage detected