{"record":{"id":"a06a51300c9f8b33","repo":"hasura/graphql-engine","slug":"the-operand-object-type-operand-type-does-not","errorCode":null,"errorMessage":"the operand object type '{operand_type}' does not contain the field '{field_name}' used in the comparable fields","messagePattern":"the operand object type '(.+?)' does not contain the field '(.+?)' used in the comparable fields","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":244,"sourceCode":"    },\n\n    #[error(\"the order by expression '{order_by_expression}' could not be found\")]\n    OrderByExpressionNotFound {\n        order_by_expression: Qualified<OrderByExpressionName>,\n    },\n\n    #[error(\"the field '{field_name}' is defined more than once in the comparable fields\")]\n    DuplicateComparableFieldsFound { field_name: FieldName },\n\n    #[error(\n        \"the field '{field_name}' used in comparable fields is not an aggregatable field defined in the aggregate expression '{aggregate_expression}'\"\n    )]\n    ComparableFieldNotFound {\n        field_name: FieldName,\n        aggregate_expression: Qualified<AggregateExpressionName>,\n    },\n\n    #[error(\n        \"the operand object type '{operand_type}' does not contain the field '{field_name}' used in the comparable fields\"\n    )]\n    ComparableFieldNotFoundOnObjectType {\n        operand_type: Qualified<CustomTypeName>,\n        field_name: FieldName,\n    },\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    )]","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L226-L262","documentation":"When resolving comparable fields, the operand object type is inspected for the referenced field. This error is thrown when the operand object type (a custom type qualified by name) does not contain the field used in the comparable fields list, meaning the comparison has no counterpart on the operand side.","triggerScenarios":"A comparable field name that exists on the aggregate expression but not on the operand object type, e.g. after the object type's schema changed or the field naming differs between the aggregate and the operand type.","commonSituations":"Connector schema evolution removing/renaming a field on the operand object type; mismatched field naming conventions between aggregate fields and object type fields; metadata referencing a stale version of the object type.","solutions":["Verify the field exists on the operand object type in the current schema and fix the name in comparable_fields","If the field was renamed, update comparable_fields (and the aggregate expression) accordingly","Regenerate metadata from the current connector schema"],"exampleFix":"// before\ncomparable_fields: [price] // operand type has 'cost', not 'price'\n\n// after\ncomparable_fields: [cost]  // matches operand object type field","handlingStrategy":"validation","validationCode":"for f in &comparable_fields {\n    assert!(operand_type.fields.contains(f), \"operand type lacks field {f}\");\n}","typeGuard":"fn field_on_type(ty: &ObjectType, f: &FieldName) -> bool {\n    ty.fields.contains(f)\n}","tryCatchPattern":"match resolve(expr) {\n    Err(ResolveError::ComparableFieldNotFoundOnObjectType { operand_type, field_name }) => {\n        // fix field name to match the operand object type's schema and retry\n    }\n    r => r,\n}","preventionTips":["Keep field naming consistent between aggregate expressions and operand object types","Validate comparable fields against the live connector schema in CI"],"tags":["rust","comparable-fields","object-type","metadata","schema-mismatch"],"backgroundTag":null,"analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}