Validate edge reference declarations directly
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user