Support checked keyed relationships across portable operations and queries

This commit is contained in:
Timothy J. Aveni
2026-09-25 12:02:05 -07:00
parent e0e8563224
commit 1bc3c69de3
23 changed files with 1203 additions and 949 deletions
+7 -1
View File
@@ -230,7 +230,13 @@ export async function compileQuery(
fail("QUERY_UNSUPPORTED_FEATURE", "Bounded-all does not accept a continuation", node);
for (const argument of node.arguments ?? []) {
if (argument.name.value === "where")
compiledPredicates.set(node, relational.predicate(objectRow(target), argument.value));
compiledPredicates.set(
node,
relational.predicate(
objectRow(target, member.keyType ? { keyType: member.keyType } : undefined),
argument.value,
),
);
if (argument.name.value === "orderBy") inputEffects(target, argument.value, "order");
if (
["first", "all"].includes(argument.name.value) &&
+5 -1
View File
@@ -242,7 +242,11 @@ export function querySchema(
first: { type: GraphQLInt },
all: { type: GraphQLInt },
after: { type: cursorScalar },
where: { type: filter(targetId) },
where: {
type: member.keyType
? relational.where(objectRow(targetId, { keyType: member.keyType }))
: filter(targetId),
},
...(ordering ? { orderBy: { type: new GraphQLList(new GraphQLNonNull(ordering)) } } : {}),
},
};