Docs menu · Reference

Applies an explicit policy to every graph node bound to the given entity target: cascade deletes the bound nodes and their incident edges, detach keeps the nodes but removes their bindings, and keep_dangling preserves the bindings so traversal can report the target’s status. The acknowledgement reports how many bound nodes the policy covered.

Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Cascade-delete graph facts bound to an entity.

CLI

$ strata graph create kb
$ strata graph add-node kb ada --binding {"target":{"key":"user:1","primitive":"kv","space":"default"}}
$ strata command run --command-json '{"policy":"cascade","target":{"key":"user:1","primitive":"kv","space":"default"},"type":"graph_apply_delete_policy"}'  # cascade removes the bound node and its incident edges.
$ strata graph get-node kb ada

Wire

{"graph":"kb","type":"graph_create"}
{"binding":{"target":{"key":"user:1","primitive":"kv","space":"default"}},"graph":"kb","node_id":"ada","type":"graph_add_node"}
{"policy":"cascade","target":{"key":"user:1","primitive":"kv","space":"default"},"type":"graph_apply_delete_policy"}
{"graph":"kb","node_id":"ada","type":"graph_get_node"}

Parameters

NameTypeRequiredDescription
policyGraphDeletePolicyyesPolicy to apply: cascade, detach, or keep_dangling.
targetGraphBindingTargetyesThe bound entity target.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

MutationAck<GraphDeletePolicyApply>.

Errors

Invocation

  • CLI: via strata command run (no dedicated verb)
  • Wire type: graph_apply_delete_policy

agents: this page as markdown → /docs/reference/graph/apply_delete_policy.md