Add explicit CRDT edit contracts and structured query values

This commit is contained in:
Timothy J. Aveni
2026-09-19 22:33:20 -07:00
parent 0555c929b1
commit 4c0c404a39
27 changed files with 3272 additions and 2745 deletions
+5 -1
View File
@@ -1,3 +1,4 @@
import { comparableValue } from "./structured.js";
import {
GraphQLBoolean,
GraphQLString,
@@ -45,6 +46,7 @@ export interface RelationalSchemaEnvironment {
name(id: InterfaceRevisionId): string;
scalar(type: ValueType): GraphQLInputType & GraphQLOutputType;
comparison(type: ValueType): GraphQLInputObjectType;
valueOrder(type: ValueType): GraphQLInputType;
scalarTypes: Map<string, ValueType>;
direction: GraphQLEnumType;
cursor: GraphQLScalarType;
@@ -255,7 +257,8 @@ export function relationalSchema(env: RelationalSchemaEnvironment, document?: Do
continue;
}
}
result[name] = { type: ordering ? env.direction : compare(type) };
if (!comparableValue(type, ordering)) continue;
result[name] = { type: ordering ? env.valueOrder(type) : compare(type) };
}
}
const meta: GraphQLInputFieldConfigMap = {};
@@ -300,6 +303,7 @@ export function relationalSchema(env: RelationalSchemaEnvironment, document?: Do
for (const [name, field] of fields(row)) {
if (row.kind === "object" && field.kind === "row") continue;
if (name in result) throw new QueryCompileError("QUERY_SCHEMA_NAME", `Reserved predicate name ${name}`);
if (field.kind === "leaf" && !comparableValue(field.type)) continue;
result[name] = { type: field.kind === "row" ? where(field.row) : compare(field.type) };
}
result._qx = {