Implement progressive query admission, session boundaries and event-driven Studio observations
This commit is contained in:
@@ -94,6 +94,9 @@ export class QueryCompileError extends Error {
|
||||
}
|
||||
}
|
||||
export interface CheckedQuery {
|
||||
/** Checked decomposition; handles belong to a Client Session, never graph values. */
|
||||
tree?: QueryTreePlan;
|
||||
treeProjection?: { tree: string; projection: string; role: "replica" | "local" };
|
||||
fragmentContracts?: Record<string, NonNullable<QuerySelection["fragmentSpread"]>>;
|
||||
declaration: QueryDeclaration;
|
||||
definitionDigest: string;
|
||||
@@ -115,6 +118,12 @@ export type QueryArgument =
|
||||
| { kind: "list"; values: QueryArgument[] }
|
||||
| { kind: "object"; fields: Record<string, QueryArgument> };
|
||||
export interface QuerySelection {
|
||||
boundary?: {
|
||||
name: string;
|
||||
root: InterfaceRevisionId;
|
||||
output: ValueType;
|
||||
location?: QuerySourceLocation;
|
||||
};
|
||||
/** A checked occurrence marker, not an output field or storage capability. */
|
||||
fragmentSpread?: {
|
||||
mode?: "reference";
|
||||
@@ -135,3 +144,27 @@ export interface QuerySelection {
|
||||
relational?: import("./relational.js").QueryRelationalPlan;
|
||||
predicate?: import("./relational.js").QueryPredicate;
|
||||
}
|
||||
|
||||
export interface QueryTreeProjection {
|
||||
id: string;
|
||||
root: QueryRoot;
|
||||
selection: QuerySelection[];
|
||||
output: ValueType;
|
||||
}
|
||||
export interface QueryTreeNode {
|
||||
id: string;
|
||||
projection: string;
|
||||
boundaries: { name: string; conditions: QuerySelection["conditions"]; node: string }[];
|
||||
bindings: {
|
||||
name: string;
|
||||
projection: string;
|
||||
/** [] denotes an occurrence in a bounded list; its entry key owns identity. */
|
||||
targets: { path: string[]; node: string }[];
|
||||
}[];
|
||||
}
|
||||
export interface QueryTreePlan {
|
||||
root: string;
|
||||
nodes: QueryTreeNode[];
|
||||
projections: QueryTreeProjection[];
|
||||
maxOccurrences: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user