Reject unsupported query operators during execution planning
This commit is contained in:
@@ -284,3 +284,27 @@ test("implementation selection is explicit, target checked and independent of ma
|
||||
"service",
|
||||
);
|
||||
});
|
||||
|
||||
test("execution planning rejects unsupported grouping before installing the query", async () => {
|
||||
const workspace = await loadReaderWorkspace((name, text) =>
|
||||
name === "queries/reader-screen.graphql"
|
||||
? text.replace("aggregate { count }", "groups(by: {color: true}, first: 10) { entries { aggregate { count } } }")
|
||||
: text,
|
||||
);
|
||||
assert.throws(() => compileExecutionPlan(workspace), /QUERY_OPERATOR_UNSUPPORTED.*grouping/);
|
||||
});
|
||||
|
||||
test("a count-only local query still requires complete relationship admission", async () => {
|
||||
for (const source of [
|
||||
"query ReplicaInputs { root { sourceRevision } }",
|
||||
"query ReplicaInputs { root { highlights(first: 1) { entries { node { color } } } } }",
|
||||
]) {
|
||||
const workspace = await loadReaderWorkspace((name, text) => {
|
||||
if (name === "queries/replica-inputs.graphql") return source;
|
||||
if (name === "queries/reader-screen.graphql")
|
||||
return "query ReaderScreen { root { _qx { relations { highlights { aggregate { count } } } } } }";
|
||||
return text;
|
||||
});
|
||||
assert.throws(() => compileExecutionPlan(workspace), /REPLICA_TRAVERSAL_MISSING|REPLICA_RELATION_INCOMPLETE/);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user