hasura/graphql-engine · error · AggregateBooleanExpressionError

the comparable relationship '{relationship_name}' for the op

Error message

the comparable relationship '{relationship_name}' for the operand type '{operand_type}' references a boolean expression type that cannot be found: '{boolean_expression_type}'

What it means

A comparable relationship must reference a boolean expression type for its target; if that boolean expression type's qualified name cannot be found among resolved types, this error is thrown. It mirrors ComparableFieldBooleanExpressionNotFound but applies to the relationship path of nested aggregation.

Source

Thrown at v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs:328

    #[error(
        "the comparable relationship '{relationship_name}' for the operand type '{operand_type}' is an array relationship. This is not supported"
    )]
    ComparableArrayRelationshipNotSupported {
        operand_type: Qualified<CustomTypeName>,
        relationship_name: RelationshipName,
    },

    #[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}'"

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Correct the qualified boolean expression type name on the comparable relationship
  2. Define/enable the missing boolean expression type for the target model's type
  3. Ensure cross-subgraph type references point at types that are actually exported in that subgraph

Example fix

# before
comparableRelationship:
  relationshipName: author
  booleanExpressionType: author_filter   # actual type is author_bool_exp

# after
comparableRelationship:
  relationshipName: author
  booleanExpressionType: author_bool_exp
Defensive patterns

Strategy: validation

Validate before calling

for r in &comparable_relationships {
    assert!(bool_exp_types.contains_key(&r.boolean_expression_type),
        "bool exp type {} not found", r.boolean_expression_type);
}

Prevention

When it happens

Trigger: Declaring a comparable relationship whose referenced boolean expression type (qualified CustomTypeName) is not defined anywhere in the resolved metadata.

Common situations: Typo or wrong namespace in the booleanExpressionType of a comparable relationship; disabling/removing the bool exp type for the target type while relationships still reference it; cross-subgraph references to types that are not exported.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/ce433715338dd62b. Report an issue: GitHub.