Skip to content

Commit 549f0bc

Browse files
committed
test(objectql): the nested-chain pins cast the context value, not the options object (the query-options-erasure ratchet counts an erased options argument)
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QK6pdbxKZiHdFApL8RYVh9
1 parent 70d95b3 commit 549f0bc

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎packages/objectql/src/engine-readable-ids-nested-composition.test.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ describe('[ADR-0139 D6 as amended] a leaf inside a composed scope is composed to
144144
calls.length = 0;
145145
});
146146

147+
// The context value is the cast, never the options object: the
148+
// query-options-erasure ratchet counts an erased options argument.
147149
const readVerbs = (where: Record<string, unknown>, context?: unknown) => [
148-
['find', () => engine.find('rid_child', { where, context } as any)],
149-
['findOne', () => engine.findOne('rid_child', { where, context } as any)],
150-
['count', () => engine.count('rid_child', { where, context } as any)],
151-
['aggregate', () => engine.aggregate('rid_child', { where, aggregations: COUNT_AGG as any, context } as any)],
150+
['find', () => engine.find('rid_child', { where, context: context as any })],
151+
['findOne', () => engine.findOne('rid_child', { where, context: context as any })],
152+
['count', () => engine.count('rid_child', { where, context: context as any })],
153+
['aggregate', () => engine.aggregate('rid_child', { where, aggregations: COUNT_AGG as any, context: context as any })],
152154
] as const;
153155

154156
/** The service of a two-level chain: the parent's scope carries a leaf over the grandparent, whose scope is plain. */

0 commit comments

Comments
 (0)