docs(query-syntax): Filtering Across Relationships states the served nested-relation form - #20906
Merged
objectstack-fleet[bot] merged 2 commits intoSep 30, 2026
Merged
Conversation
…nested-relation form
Contributor
Author
Contract reviewServed-tier: ① Derived judgments
② Semver levelDocs only, one ③ Boundary flags
Implemented-by: VERDICT: PASS |
objectstack-fleet
Bot
deleted the
claude/issue-20876-relation-filter-docs
branch
September 30, 2026 17:39
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20876
Clause-②: no
What changed
content/docs/protocol/objectql/query-syntax.mdx, section "Filtering Across Relationships" only. The old callout said relation traversal inwhereis "not supported" and blamedSqlDriver.applyFilters()for compiling a nested object and emitting a dotted key to Knex. Both were false: the headline since PR #20872 (ca5408c62), the mechanism sentences since the engine refuses the nested form before any driver. The section now states the served form, per triage 5914865117:{ relation: { field: value } }inwhere, one level, forward only, evaluated as the caller; a multi-valued relation matches any member; refused past 1000 ids; an unreadable related field answers403.INVALID_FIELD/ 400; an aggregation'sfilterandhavingrefuse the form.Code anchors (all at
origin/main33b6e8b)packages/objectql/src/engine.ts:11268(resolveRelateThenLowerWhere, callslowerRelationConditionsat :11276); the related read is the engine's ownfindwith the caller's context,:11322.$invs$contains:packages/objectql/src/relation-filter-lowering.ts:213-218(lowerRelationSite):$infor single-valued, an$orof one$containsper id formultiple: true.RELATION_FILTER_ID_CAP = 1000atrelation-filter-lowering.ts:84; read asks for cap+1 (engine.ts:11325), refuses at:11330viarelationFilterCapError(relation-filter-lowering.ts:297) asINVALID_FILTER/ 400 (filter-comparand-shape.ts:78-85).assertReadableQueryFields(packages/plugins/plugin-security/src/predicate-guard.ts:106, called atsecurity-plugin.ts:3652),PERMISSION_DENIED/ 403. Pinned:engine-nested-relation-lowering.test.ts:227,packages/rest/src/data-nested-relation-permission.test.ts.admitRelationCondition,relation-filter-lowering.ts:162; dotted key inside the condition:189, relation key inside:197(second-level), bothINVALID_FILTER/ 400. Pinned:engine-nested-relation-lowering.test.ts:284,packages/rest/src/data-nested-object-door.test.ts(REFUSED table).relation-filter-lowering.ts:16-17); over REST the parent has no such field, soassertFilterFieldsExistanswersINVALID_FIELD/ 400 (packages/metadata-protocol/src/protocol.ts:10057, called at:11510). The directengine.findhas no field-name door (query-syntax.mdxsection 9, "Unknown Fields Are Tolerated"), so the page states the reverse refusal for the REST doors only.classifyDottedFilterHead(packages/spec/src/data/filter-dotted-head.ts:119); engine doorassertFilterIsMaterializable(filter-comparand-shape.ts:204, code set at:270); REST ingressprotocol.ts:10114.findengine.ts:11662,findOne:11935,update:13558,delete:16227,count:16760,aggregate:17138; pinned for all six plusjudgeFilteratengine-nested-relation-lowering.test.ts:190. REST:GET /data/:objectandPOST /data/:object/query(packages/rest/src/rest-server.ts:8635,:8818) both callfindData(protocol.ts:11183); the POST query door is the one the REST test drives.aggregations[i].filterandhavingrefuse the form:no-operator-object-door.ts:307; pinnedengine-nested-relation-lowering.test.ts:329, RESTdata-nested-object-door.test.ts:256.Shared wording with #20888
The skill half is PR #20902 (open, not merged). Two passages are quoted verbatim from its
skills/objectstack-query/rules/filters.md: the served-form sentence ("A condition on a related record's fields beneath a relation field ... any member whenmultiple: true).") and the "Limits — one level: ..." sentence. The code sentence is identical; if #20902 changes those sentences before landing, this page must be re-quoted.Census of hand-written
content/docs/**Searched: "Relation traversal", "not supported" near where/relation,
applyFilters, dotted'account.examples, "two queries" / "$in its ids" / "nested form".protocol/objectql/query-syntax.mdx(the section above), the only hit.kernel/contracts/data-engine.mdx:187-215states the served form, the 1000 cap, one level,403, aggregationfilter/havingand the dotted refusal (landed with feat(objectql): serve the nested-relation filter in where — lowered at the engine seam, the related object read as the caller, a loud cap, drivers untouched (#20802) #20872).permissions/*.mdxdotted'account.annual_revenue'keys are field-permission keys, not filters;protocol/objectql/types.mdx:1035'metadata.color'is the deliberate structured/JSON carve-out;query-syntax.mdx:1135/:1167 anddata-modeling/queries.mdx:442,519,schema-design.mdx:111,api/data-api.mdx:177concern the search axis andexpand/fieldspaths, notwhere.content/docs/references/**) not touched. Also fixed (contract review, second commita2a66881e2): thequery-syntax.mdxline 4 frontmatterdescriptionlisted "joins", a tombstoned key (packages/spec/src/data/query.zod.ts:562; the page says so at its Joins section); it now reads "expand", which the page's section 4 (Relationships (Expand)) covers.Gates
node scripts/pm/dispatch-gates.mjs --commandsderived 40 commands at heada2a66881e2(re-run after the second commit; the first pass was atbd718b653a); 39 ran green (exit 0) afterpnpm installand a lint-closure build.--ranreconciliation: 39 of 40 run, 1 UNRUN:pnpm --filter @objectstack/spec run check:skill-examplesexited 3 (prerequisite: the client-SDK surface has no built output). NOT MEASURED: it type-checks marked TypeScript examples in skills and docs, and this diff adds no marked block. CI owns it. No changeset (docs only, nothing published).🤖 Generated with Claude Code
https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv