Also, this is valid part of code
const disconnectingAllExistingRelations = Array.isArray(entityDataValue) &&
!cmsDataValue?.connect.length &&
cmsDataValue?.disconnect.length === entityDataValue.length;
if (connectingNoRelation || disconnectingAllExistingRelations) {
throw new ValidationError(`Missing "${relationName}" relation. Please fill in the required relation field.`);
}