Add exported query fragments and scoped coverage observations
This commit is contained in:
@@ -35,6 +35,14 @@ export type QueryRoot<Interface = InterfaceRevisionId> =
|
||||
| { kind: "object"; interface: Interface }
|
||||
| { kind: "workspace-interface"; interface: Interface };
|
||||
export interface QueryDeclaration {
|
||||
/** Exported local projection; compilation also creates its direct admission. */
|
||||
fragment?: { name: string; operation?: string; admission?: boolean };
|
||||
importedFragments?: {
|
||||
packageRevisionId: string;
|
||||
packageAlias?: string;
|
||||
fragmentId: string;
|
||||
variables: Record<string, string>;
|
||||
}[];
|
||||
placement?: { kind: "replica" } | { kind: "local"; sourceQueryId: string };
|
||||
id: string;
|
||||
displayName: string;
|
||||
@@ -83,6 +91,7 @@ export class QueryCompileError extends Error {
|
||||
}
|
||||
}
|
||||
export interface CheckedQuery {
|
||||
fragmentContracts?: Record<string, NonNullable<QuerySelection["fragmentSpread"]>>;
|
||||
declaration: QueryDeclaration;
|
||||
definitionDigest: string;
|
||||
/** Fixed, validated document: never supplied by runtime callers. */
|
||||
@@ -102,6 +111,14 @@ export type QueryArgument =
|
||||
| { kind: "list"; values: QueryArgument[] }
|
||||
| { kind: "object"; fields: Record<string, QueryArgument> };
|
||||
export interface QuerySelection {
|
||||
/** A checked occurrence marker, not an output field or storage capability. */
|
||||
fragmentSpread?: {
|
||||
package: string;
|
||||
fragment: string;
|
||||
digest: string;
|
||||
root: InterfaceRevisionId;
|
||||
variables: Record<string, string>;
|
||||
};
|
||||
name: string;
|
||||
key: string;
|
||||
interfaceRevisionId?: InterfaceRevisionId;
|
||||
|
||||
Reference in New Issue
Block a user