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 field '{field_name}' could not be found

What it means

During resolution of comparable fields, the resolver could not find the boolean expression type that is supposed to be attached to a comparable (nested) field. Each comparable field that references another type must have a matching boolean expression type registered in the metadata; if the qualified name lookup fails, this error is raised.

Source

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

    },

    #[error(
        "the operand object type '{operand_type}' does not contain the field '{field_name}' used in the comparable fields"
    )]
    ComparableFieldNotFoundOnObjectType {
        operand_type: Qualified<CustomTypeName>,
        field_name: FieldName,
    },

    #[error(
        "the type of the comparable field '{field_name}' ({field_type}) is an array type. Nested aggregation over array types is not supported"
    )]
    ComparableFieldNestedArrayTypeNotSupported {
        field_name: FieldName,
        field_type: QualifiedTypeReference,
    },

    #[error(
        "the boolean expression type ({boolean_expression_type}) used in the comparable field '{field_name}' could not be found"
    )]
    ComparableFieldBooleanExpressionNotFound {
        field_name: FieldName,
        boolean_expression_type: Qualified<CustomTypeName>,
    },

    #[error(
        "the boolean expression type ({boolean_expression_type}) used in the comparable field '{field_name}' must have a '{aggregate_operand_type}' operand, to match the field type '{field_type}'"
    )]
    ComparableFieldBooleanExpressionIncorrectOperandType {
        boolean_expression_type: Qualified<CustomTypeName>,
        aggregate_operand_type: AggregateOperandType,
        field_name: FieldName,
        field_type: QualifiedTypeName,
    },

    #[error(

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify the exact qualified name (including subgraph/namespace) of the boolean expression type referenced by the comparable field and fix typos/casing
  2. Define the missing boolean expression type (or add the appropriate annotation) for the nested type in the metadata
  3. Ensure the referenced type is properly exported/available in the subgraph where it is used

Example fix

// before
comparableField:
  fieldName: author
  booleanExpressionType: author_bool_exp   // wrong name; actual type is AuthorBoolExp

// after
comparableField:
  fieldName: author
  booleanExpressionType: AuthorBoolExp
Defensive patterns

Strategy: validation

Validate before calling

let exists = resolved_bool_exp_types.contains_key(&comparable_field.boolean_expression_type);
if !exists { /* fail fast with a clear message before resolve */ }

Prevention

When it happens

Trigger: A comparable field references a boolean expression type (e.g. via the type's aggregate bool exp annotation) whose qualified <subgraph::TypeName> is not present among the resolved boolean expression types.

Common situations: Typo or case mismatch in the boolean expression type name, forgetting to define/enable the boolean expression type for the nested type, or referencing a type from a different subgraph/namespace that hasn't been declared or exported.

Related errors


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