{"record":{"id":"74ad3fd49b6ec9a7","repo":"hasura/graphql-engine","slug":"the-boolean-expression-type-boolean-expression-t-74ad3f","errorCode":null,"errorMessage":"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}'","messagePattern":"the boolean expression type \\((.+?)\\) used in the comparable field '(.+?)' must have a '(.+?)' operand, to match the field type '(.+?)'","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":268,"sourceCode":"    },\n\n    #[error(\n        \"the type of the comparable field '{field_name}' ({field_type}) is an array type. Nested aggregation over array types is not supported\"\n    )]\n    ComparableFieldNestedArrayTypeNotSupported {\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n\n    #[error(\n        \"the boolean expression type ({boolean_expression_type}) used in the comparable field '{field_name}' could not be found\"\n    )]\n    ComparableFieldBooleanExpressionNotFound {\n        field_name: FieldName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\n        \"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}'\"\n    )]\n    ComparableFieldBooleanExpressionIncorrectOperandType {\n        boolean_expression_type: Qualified<CustomTypeName>,\n        aggregate_operand_type: AggregateOperandType,\n        field_name: FieldName,\n        field_type: QualifiedTypeName,\n    },\n\n    #[error(\n        \"the type of the comparable field '{field_name}' ({field_type}) does not match the operand type of the boolean expression type '{boolean_expression_type}': '{boolean_expression_operand_type}'\"\n    )]\n    ComparableFieldBooleanExpressionTypeMismatch {\n        field_name: FieldName,\n        field_type: QualifiedTypeName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n        boolean_expression_operand_type: QualifiedTypeName,\n    },","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L250-L286","documentation":"The boolean expression type used by a comparable field must expose an operand type that matches the field's own type so aggregation comparisons can be built consistently. This error fires when that boolean expression type does not declare an operand of the required AggregateOperandType (e.g. it only has _comparison for a numeric field, or vice versa).","triggerScenarios":"A comparable field with type T points at a boolean expression type whose operand types (as declared for aggregation, e.g. comparison vs. aggregate operands) do not include the operand type required by T.","commonSituations":"Reusing an existing boolean expression type (written for equality/comparison filters) as the aggregate bool exp for a numeric/comparable field; mixing up comparison-only expression types with aggregation expression types when wiring comparable fields.","solutions":["Point the comparable field at a boolean expression type that declares the required operand type matching the field","Add the missing operand type to the boolean expression type's definition in the metadata","Regenerate/extend the boolean expression type for the field's scalar type using the standard aggregate bool exp pattern"],"exampleFix":"// before\n// field type is Float but the referenced bool exp type only has a String operand\ncomparableField:\n  fieldName: rating\n  booleanExpressionType: string_bool_exp\n\n// after\ncomparableField:\n  fieldName: rating\n  booleanExpressionType: float_bool_exp  // declares a matching numeric operand","handlingStrategy":"validation","validationCode":"let operands = bool_exp_type.operands();\nassert!(operands.contains(&required_operand_for(&field.field_type)),\n    \"bool exp type lacks operand matching field type\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use scalar-matched bool exp types consistently (int -> numeric operand, string -> string operand)","Add a metadata lint rule that checks operand availability per comparable field"],"tags":["rust","hasura","metadata","aggregation","operand-type-mismatch"],"backgroundTag":"schema-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}