Validate edge reference declarations directly
This commit is contained in:
Vendored
+2
-3
@@ -511,9 +511,8 @@ const classSchemaFromType = (type, sourceFile, defaults, operationServices) => {
|
||||
if (!declaredToEndpoint.projection) {
|
||||
throw new Error(`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