Guide
sub() starts an inline traversal that consumes the current stream. Use it for
branching operations; use g() only for a top-level traversal entry.
Branching operations
Retain row-local values
Combine branches with bindings to keep one stable row shape across alternative paths. Bind the starting service, useoptional and union sub-traversals to bind each candidate workload path, then
project with projectDistinctBindings and coalesce. See
Project correlated bindings.
Gate later entries
A batch condition runs an entry only when an earlier entry’s result meets a test. Add the entry withvarAsIf / var_as_if instead of varAs. This request returns a
user’s posts only when the user exists:
varEmpty), a minimum size (varMinSize), or
the previous entry (prevNotEmpty). The first entry in a batch cannot depend on a
previous result.
Cypher has no batch conditions. In the Cypher tab, the second MATCH runs once for
each user the first one finds, so the statement returns no rows when the user does
not exist.
Bound recursive work
Recursive and fan-out operations must have application-level bounds. Prefer explicit depth, candidate, and response limits. A responselimit does not necessarily bound
all work performed before that operation.
Next steps
Projection and bindings
Emit stable rows from correlated paths.
Parameters
Bind values and bounds at request time.