Add explicit CRDT edit contracts and structured query values
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user