Expand description
Shared Helix query AST.
This crate owns the public JSON contract used by SDKs and the planner. The
wire format is an operation tree: each traversal builder call creates one
node, and chaining wraps the previous root as that node’s input.
Modules define the stable contract boundaries:
valuecontains JSON/property values and mutation inputs.exprcontains predicates, expressions, and stream bounds.traversalcontains the operation-tree AST and traversal builders.batchandquerycontain batch and request wire formats.
use helix_ast::prelude::*;
let query = read_batch()
.var_as(
"users",
g()
.n_with_label("User")
.where_(Predicate::eq("username", "alice"))
.limit(1),
)
.returning(["users"]);
let json = sonic_rs::to_string(&query).unwrap();
assert!(json.contains(r#""root":{"limit""#));
assert!(json.contains(r#""input":{"where""#));
assert!(json.contains(r#""eq":{"left":{"property":"username"}"#));