v2.10.1
Patch Changes
-
#122
9fa981eThanks @flyon! - DSL-JSON is now the compact, IR-free "Z-c" wire grammar.query.toJSON()no longer embeds
IRExpressionin where-clauses or{kind:…}value tags in mutations — the wire reads like the DSL,
andfromJSON()rehydrates it losslessly (lower(fromJSON(query.toJSON())) ≡ lower(query)).(Pre-adoption, so this ships as a patch despite the wire-shape change — there are no published
consumers of the old format to protect.)Where-clauses are path-keyed conditions with an S-expr fallback:
Values follow one grammar: a bare scalar is a literal;
{id}a node ref;{$ctx}/{$ctx,path}a
query-context reference;{date},{list},{unset},{add,remove}the tagged kinds; a computed
value is an S-expr.Projections use bare dotted-string leaves (
"name","friends.friends.name"),{as, value}for
computed fields, scoped relation filters, and inlineas(<ShapeLabel>)casts.Mutations carry path-keyed node data:
{ "op": "create", "shape": "…/Person", "data": { "name": "Alice", "bestFriend": { "name": "Bestie" }, "friends": { "list": [{ "id": "…" }] } } }with reserved
__id(a fixed/predefined id) and__shape(the concrete shape, emitted only for a
subclass instance under a superclass-typed relation).Envelope:
sortByis now an ordered array of{path: direction}(element order = precedence);
.one()serializes asone(wassingleResult); the deprecatedorderDirectionis gone.Breaking / behavioral notes
- The wire shape of
query.toJSON()changed across the board; anything that read the old
IR-embedding /{shape,fields}/{kind:…}forms must move to the Z-c grammar. - The exported types
MutationValueJSONandMutationNodeDataJSONchanged shape accordingly. and,or, andnotare now reserved property labels (they are boolean combinators in a
where-clause and have no key-position escape) — declaring a property with one of those names throws
at shape registration.
See the full DSL-JSON specification. Deferred edge items are tracked
indocs/backlog/002-dsl-json-zc-open-items.md. - The wire shape of
{ "where": { "name": "Alice", "age": { ">": 18 } } } // implicit equals + implicit AND { "where": { "friends.some": { "name": "Moa" } } } // quantifiers: some / every / none { "where": ["<", ["+", ["STRLEN", {"path":"name"}], 10], 100] } // computed → S-expr array