Support checked keyed relationships across portable operations and queries
This commit is contained in:
@@ -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
@@ -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)) } } : {}),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user