Skip to content

feat: support orderBy on edge properties in query builder#77

Merged
pdlug merged 1 commit into
mainfrom
feat/edge-order-by
Apr 5, 2026
Merged

feat: support orderBy on edge properties in query builder#77
pdlug merged 1 commit into
mainfrom
feat/edge-order-by

Conversation

@pdlug
Copy link
Copy Markdown
Contributor

@pdlug pdlug commented Apr 5, 2026

  • Widen orderBy to accept edge aliases (keyof EdgeAliases) in addition to node aliases, allowing database-level ordering by properties on traversed edges
  • Extract shared buildAliasToCteMap utility to correctly map edge aliases to the CTE of the node they are co-projected with
  • Fix CTE alias resolution for edge aliases in buildStandardOrderBy, buildStandardGroupBy, and buildStandardVectorOrderBy
store.query()
  .from("Person", "p")
  .traverse("worksAt", "e")
  .to("Company", "c")
  .orderBy("e", "salary", "asc")  // now works — was a type error before
  .select((ctx) => ({ name: ctx.p.name, salary: ctx.e.salary }))
  .execute();

Closes #76

@pdlug pdlug force-pushed the feat/edge-order-by branch from d80f3c8 to 3170a3b Compare April 5, 2026 22:31
Widen orderBy to accept edge aliases, allowing results to be ordered by
properties on traversed edges. Extract shared alias-to-CTE map utility
and fix CTE resolution for edge aliases in orderBy, groupBy, and vector
orderBy compilation paths.

Closes #76
@pdlug pdlug force-pushed the feat/edge-order-by branch from 3170a3b to 45fdce2 Compare April 5, 2026 22:35
@pdlug pdlug merged commit b9fc057 into main Apr 5, 2026
10 checks passed
@pdlug pdlug deleted the feat/edge-order-by branch April 5, 2026 22:39
@github-actions github-actions Bot mentioned this pull request Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support orderBy on edge properties in query builder

1 participant