hasura/graphql-engine · error · AggregateBooleanExpressionError
the boolean expression type '{boolean_expression_type}' used
Error message
the boolean expression type '{boolean_expression_type}' used in the comparable relationship '{relationship_name}' does not have an object aggregate operand What it means
While resolving comparable relationships, the metadata resolver found the boolean expression type referenced by the relationship, but that boolean expression type has no operand of an object aggregate type. Comparable relationships rely on the boolean expression type having an object aggregate operand (the target type being aggregated/compared), so the relationship cannot be resolved. This is thrown during metadata-resolve's aggregate_boolean_expressions stage when validating the shape of the named boolean expression type.
Source
Thrown at v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs:337
#[error(
"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' targets a model than cannot be found: '{target_model_name}'"
)]
ComparableRelationshipTargetModelNotFound {
operand_type: Qualified<CustomTypeName>,
relationship_name: open_dds::relationships::RelationshipName,
target_model_name: Qualified<open_dds::models::ModelName>,
},
#[error(
"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' references a boolean expression type that cannot be found: '{boolean_expression_type}'"
)]
ComparableRelationshipBooleanExpressionNotFound {
operand_type: Qualified<CustomTypeName>,
relationship_name: open_dds::relationships::RelationshipName,
boolean_expression_type: Qualified<CustomTypeName>,
},
#[error(
"the boolean expression type '{boolean_expression_type}' used in the comparable relationship '{relationship_name}' does not have an object aggregate operand"
)]
ComparableRelationshipBooleanExpressionIncorrectOperandType {
relationship_name: open_dds::relationships::RelationshipName,
boolean_expression_type: Qualified<CustomTypeName>,
},
#[error(
"the object type of the target of the relationship '{relationship_name}' ({relationship_target_object_type}) does not match the operand type of the boolean expression type '{boolean_expression_type}': '{boolean_expression_operand_type}'"
)]
ComparableRelationshipBooleanExpressionTypeMismatch {
relationship_name: open_dds::relationships::RelationshipName,
relationship_target_object_type: Qualified<CustomTypeName>,
boolean_expression_type: Qualified<CustomTypeName>,
boolean_expression_operand_type: Qualified<CustomTypeName>,
},
#[error("the filter input model '{model_name}' cannot be found")]View on GitHub (pinned to 724551b9ae)
Solutions
- Check the operand list of the boolean expression type named in the error and add an operand whose type is an object aggregate operand matching the relationship target.
- Point the relationship's boolean_expression_type at the correct boolean expression type defined for the relationship's target object type.
- If the target type is wrong, fix the relationship target so it matches the object aggregate operand that already exists.
Example fix
# before
boolean_expressions:
ArticleBoolExp:
operands:
title: StringComparison # no object aggregate operand
relationships:
comparable:
- name: articleComparable
boolean_expression_type: ArticleBoolExp
target_object_type: Article
# after
boolean_expressions:
ArticleBoolExp:
operands:
title: StringComparison
_aggregate: ArticleAggregateBoolExp # object aggregate operand for target Article Defensive patterns
Strategy: validation
Validate before calling
// before resolving, verify the boolean expression type used by each comparable relationship
// has an object-aggregate operand:
fn has_object_aggregate_operand(bool_exp: &BooleanExpressionType) -> bool {
bool_exp.operands.iter().any(|op| matches!(op.kind, OperandKind::ObjectAggregate { .. }))
}
for rel in &metadata.comparable_relationships {
let be = bool_exp_types.get(&rel.boolean_expression_type)
.expect("boolean expression type must exist");
assert!(has_object_aggregate_operand(be),
"{} lacks an object aggregate operand", rel.boolean_expression_type);
} Prevention
- Derive boolean expression types from the target object type instead of hand-writing them.
- Run metadata resolve in CI to catch operand-shape errors before deploy.
When it happens
Trigger: Defining an open_dds comparable relationship whose boolean_expression_type points at a boolean expression type whose operands are all scalar comparisons (or the operand is not the object-aggregate-shaped operand), e.g. a relationship on type A targeting type B but reusing a boolean expression type built for scalar/explosion operands instead of the _aggregate operand for B.
Common situations: Copying a boolean expression type from another type and pointing a comparable relationship at it; upgrading OpenDD spec versions where operand kinds were split into object aggregate vs comparison operands; hand-writing the boolean expression type instead of deriving it.
Related errors
- the object type of the target of the relationship '{relation
- The field {field_name:} has type {field_type:} but the field
- error fetching config from server: %w
- error fetching server config: %v
- error while creating http client with TLS configuration %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/45ba685f87195fd1.
Report an issue: GitHub.