Symptom
POST /api/v1/data/showcase_invoice/query with
{"expand":{"account":{"object":"showcase_account","fields":["name"]}}}
answers 200 with account left as the raw FK id — the expansion silently did not happen. Adding "id" to the nested projection ("fields":["id","name"]) expands correctly. Confirmed 2/2 on a second object pair.
Expected: account carries the related record projected to name, or a refusal. Nothing in the response distinguishes "expanded" from "not expanded" — the field just still holds an id, which is a valid-looking value.
The stakes are raised by where the failing spelling comes from: it is the form prescribed verbatim in two spec retirement messages (FIELD_NODE_OBJECT_FORM_REMOVED and QUERY_JOINS_REMOVED) and in this checklist item's own steps. A caller who does exactly what the error message told them to do gets a silent no-op.
Root cause
expandRelatedRecords (packages/objectql/src/engine.ts) forwards nestedAST.fields to the sub-find, then keys recordMap on rec.id. A nested projection that omits id therefore yields an empty map, and the injection falls through to recordMap.get(val) ?? val — i.e. the original FK value is written back and the expansion is indistinguishable from never having been requested.
Fix shape: id must be added to the sub-read's projection unconditionally (it is the join key, not a caller-chosen column) and stripped from the emitted nested record if the caller did not ask for it — or, failing that, the mismatch must be refused rather than degraded.
Reproduction
- Boot showcase on a fresh isolated file DB (
SqlDriver / better-sqlite3); authenticate as admin@objectos.ai.
POST /api/v1/data/showcase_invoice/query body {"expand":{"account":{"object":"showcase_account","fields":["name"]}}} → 200, account is the raw FK id.
- Add
"id": {"expand":{"account":{"object":"showcase_account","fields":["id","name"]}}} → expands correctly.
- Repeat on a second object pair (
showcase_task → project) — same 2/2 result.
Source
Extracted from the QA run #7463 (framework a86db17).
Symptom
POST /api/v1/data/showcase_invoice/querywith{"expand":{"account":{"object":"showcase_account","fields":["name"]}}}answers
200withaccountleft as the raw FK id — the expansion silently did not happen. Adding"id"to the nested projection ("fields":["id","name"]) expands correctly. Confirmed 2/2 on a second object pair.Expected:
accountcarries the related record projected toname, or a refusal. Nothing in the response distinguishes "expanded" from "not expanded" — the field just still holds an id, which is a valid-looking value.The stakes are raised by where the failing spelling comes from: it is the form prescribed verbatim in two spec retirement messages (
FIELD_NODE_OBJECT_FORM_REMOVEDandQUERY_JOINS_REMOVED) and in this checklist item's own steps. A caller who does exactly what the error message told them to do gets a silent no-op.Root cause
expandRelatedRecords(packages/objectql/src/engine.ts) forwardsnestedAST.fieldsto the sub-find, then keysrecordMaponrec.id. A nested projection that omitsidtherefore yields an empty map, and the injection falls through torecordMap.get(val) ?? val— i.e. the original FK value is written back and the expansion is indistinguishable from never having been requested.Fix shape:
idmust be added to the sub-read's projection unconditionally (it is the join key, not a caller-chosen column) and stripped from the emitted nested record if the caller did not ask for it — or, failing that, the mismatch must be refused rather than degraded.Reproduction
SqlDriver/ better-sqlite3); authenticate asadmin@objectos.ai.POST /api/v1/data/showcase_invoice/querybody{"expand":{"account":{"object":"showcase_account","fields":["name"]}}}→200,accountis the raw FK id."id":{"expand":{"account":{"object":"showcase_account","fields":["id","name"]}}}→ expands correctly.showcase_task→project) — same 2/2 result.Source
Extracted from the QA run #7463 (framework a86db17).