Validate edge reference declarations directly

This commit is contained in:
Timothy J. Aveni
2026-09-03 09:47:35 -07:00
parent 833518c3ea
commit 69441e9465
3 changed files with 5 additions and 9 deletions
+2 -5
View File
@@ -718,11 +718,8 @@ const classSchemaFromType = (
`Edge field ${type.fullName}.${field.name} requires other_endpoint.projection or inverse`,
);
}
const sourceType = typeRefForField(field, defaults.schemaVersion);
if (
sourceType.symbol?.namespace !== "camino" ||
sourceType.symbol.name !== "Ref"
) {
const sourceProtoType = field.resolvedType?.fullName?.replace(/^\./, "");
if (sourceProtoType !== "camino.Ref") {
throw new Error(`Edge field ${type.fullName}.${field.name} must use camino.Ref`);
}
const isMany = isManyCardinality(declaredFromEndpoint.cardinality);