Skip to content

Commit 532bb01

Browse files
committed
docs(objectql): state the expand projection contract — id is not required in a nested fields (#7537)
The page's own documented output (`account: { company_name: 'Acme Corp' }`) was already the intended behaviour; the implementation was what had drifted. Now that the join key is added to the sub-read and stripped when unrequested, say so explicitly, so an author reading the retirement messages' prescribed spelling can see it is complete. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJVZqLviCkZMJV8Nh3DUao
1 parent 48acb77 commit 532bb01

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

content/docs/protocol/objectql/query-syntax.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,12 @@ The nested `where` is **AND-merged** with the batch `$in` the engine uses to loa
670670
records, so a related record is attached only when it also matches your filter. A foreign
671671
key whose target is filtered out is left as the raw id (unresolved) rather than dropped.
672672

673+
The nested `fields` is a **projection of the related record**, and you do not have to name
674+
`id` in it to make the expansion work. `id` is the join key the batch `$in` re-attaches by,
675+
so the engine adds it to its own sub-read and strips it back out when you did not ask for
676+
it — the attached record carries exactly the columns you listed. Name `id` explicitly when
677+
you want it (e.g. to link to the related record).
678+
673679
<Callout type="warn">
674680
**Per-parent shaping (`limit` / `offset` / `orderBy`) is not honored on the expand path.**
675681
The engine batch-loads every parent's related records in a single `$in` query and then

0 commit comments

Comments
 (0)