Commit eb33313
docs(getting-started): fix swapped master_detail delete-behavior default (#9179)
common-patterns.mdx told authors master_detail defaults to
deleteBehavior: set_null and that they must set cascade explicitly to
get it. Both clauses are false, and the two defaults are swapped onto
the wrong field type:
- a master_detail field with no deleteBehavior cascades — set_null is
not even reachable on that branch of the engine's resolution
ternary (packages/objectql/src/engine.ts, cascadeDeleteRelations);
- set_null is the default for the *other* branch: a plain reference
(lookup) with no deleteBehavior.
The harmful reading was the passive one: a reader who took the page
at its word concluded their child rows were safe by default and
changed nothing, then lost them silently on the next parent delete.
This also contradicts the repo's own correct reference page,
content/docs/protocol/objectql/types.mdx ("Always cascade" for
master_detail).
Corrected the sentence to match the engine and types.mdx, and added
the reason cascade is the right default: a master_detail child has no
independent existence. Docs-only; no engine change.
Fixes #9164
Co-authored-by: Claude <noreply@anthropic.com>1 parent fbb247c commit eb33313
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
0 commit comments