{"record":{"id":"9d5e1e9dee63a392","repo":"hasura/graphql-engine","slug":"the-type-of-the-comparable-field-field-name-9d5e1e","errorCode":null,"errorMessage":"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}'","messagePattern":"the type of the comparable field '(.+?)' \\((.+?)\\) does not match the operand type of the boolean expression type '(.+?)': '(.+?)'","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":278,"sourceCode":"    #[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    },\n\n    #[error(\n        \"the relationship '{relationship_name}' is defined more than once in the comparable relationships\"\n    )]\n    DuplicateComparableRelationshipsFound {\n        relationship_name: open_dds::relationships::RelationshipName,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' was not found for the operand type '{operand_type}'\"","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L260-L296","documentation":"A stricter variant of the operand check: the field's resolved QualifiedTypeName must equal the operand type declared by the boolean expression type used for that comparable field. If the two qualified type names differ (e.g. different scalar names or different type kinds), resolution aborts with this mismatch error.","triggerScenarios":"The comparable field's type is QualifiedTypeName A while the boolean expression type's operand is QualifiedTypeName B, with A != B, during resolution of the boolean expression type's comparable fields.","commonSituations":"Renaming a scalar type in one place but not the other; using custom scalar names (e.g. MyInt vs Int) inconsistently between the model field and the boolean expression type operands; copy-pasting bool exp definitions between models with different scalar sets.","solutions":["Align the field's type with the operand type: either change the field's scalar or update the bool exp type's operand to the same qualified type name","If a custom scalar is used, make sure both the field and the operand reference the identical qualified name","Regenerate boolean expression types from the current model schema after type renames"],"exampleFix":"// before\nfield: { name: rating, type: Float }\nboolExpOperand: numeric_comparison_exp  // operand type is Int\n\n// after\nfield: { name: rating, type: Float }\nboolExpOperand: float_comparison_exp    // operand type is Float","handlingStrategy":"validation","validationCode":"assert_eq!(\n    qualified_name_of(field.field_type),\n    bool_exp_type.operand_type,\n    \"field type and bool exp operand type must match exactly\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use one custom scalar naming convention everywhere; avoid mixing built-in and custom names for the same scalar","Regenerate bool exp types after any schema type rename"],"tags":["rust","hasura","metadata","type-mismatch","boolean-expression"],"backgroundTag":"schema-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}