Implement checked aggregation plans, native SQL, and bounded RPC capture
This commit is contained in:
Vendored
+9
@@ -55,6 +55,13 @@ export async function queryWorkspaceFixture() {
|
||||
allow TaskFacts.score predicate "Bounded local collection";
|
||||
allow TaskFacts.score order "Bounded local collection";
|
||||
}
|
||||
query Totals id "totals" root Collection<interface TaskFacts> document "totals.graphql" operation "Totals" {
|
||||
max rows 30; watch;
|
||||
}
|
||||
query ScoreTotals id "score-totals" root Collection<interface TaskFacts> document "score-totals.graphql" operation "ScoreTotals" {
|
||||
max rows 30; max candidates 60;
|
||||
allow TaskFacts.score aggregate "Complete bounded collection report";
|
||||
}
|
||||
}`;
|
||||
sources.Queries = packageSource;
|
||||
const pkgResult = compileCapabilityResourceSource(packageSource, {
|
||||
@@ -70,6 +77,8 @@ export async function queryWorkspaceFixture() {
|
||||
"row.graphql": `fragment TaskRow on TaskFacts {title rank done assignee {name}}`,
|
||||
"enriched.graphql": `query Enriched {root {items(first: 3) {entries {key node {_qx {ref} title score}}}}}`,
|
||||
"ranked.graphql": `query Ranked {root {items(first: 3, where: {score: {gt: 0}}, orderBy: [{score: DESC}]) {entries {key node {_qx {ref} title}}}}}`,
|
||||
"totals.graphql": `query Totals {root {_qx {relations {items {aggregate {count sum {rank}} groups(by: {done: true}, first: 10) {entries {group {done} aggregate {count sum {rank}}}}}}}}}`,
|
||||
"score-totals.graphql": `query ScoreTotals {root {_qx {relations {items {aggregate {count sum {score}}}}}}}`,
|
||||
};
|
||||
pkg.checkedQueries = await Promise.all(
|
||||
pkg.queries!.map((query) => compileQuery(query, allInterfaces, async (name) => documents[name]!)),
|
||||
|
||||
Reference in New Issue
Block a user