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

Function resolveProjectedOrderValue

packages/graph/src/Steps.ts:7107–7119  ·  view source on GitHub ↗
(
  path: TraversalPath<any, any, any>,
  key: string | undefined,
)

Source from the content-addressed store, hash-verified

7105}
7106
7107function resolveProjectedOrderValue(
7108 path: TraversalPath<any, any, any>,
7109 key: string | undefined,
7110): unknown {
7111 if (key === undefined) {
7112 return path.value;
7113 }
7114
7115 // First try to get the value as a bound variable (for aliases like `WITH a.num AS val`)
7116 // then fall back to property access (for expressions like `ORDER BY a.num`)
7117 const pathNode = path.get(key);
7118 return pathNode !== undefined ? pathNode.value : path.property(key as never);
7119}
7120
7121/**
7122 * Expression type for UNWIND - can be a literal list, null, property access, variable reference, parameter, function call, or general expression.

Callers 1

traverseMethod · 0.85

Calls 2

getMethod · 0.65
propertyMethod · 0.45

Tested by

no test coverage detected