{"record":{"id":"ce433715338dd62b","repo":"hasura/graphql-engine","slug":"the-comparable-relationship-relationship-name-ce4337","errorCode":null,"errorMessage":"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' references a boolean expression type that cannot be found: '{boolean_expression_type}'","messagePattern":"the comparable relationship '(.+?)' for the operand type '(.+?)' references a boolean expression type that cannot be found: '(.+?)'","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":328,"sourceCode":"\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' is an array relationship. This is not supported\"\n    )]\n    ComparableArrayRelationshipNotSupported {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' targets a model than cannot be found: '{target_model_name}'\"\n    )]\n    ComparableRelationshipTargetModelNotFound {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: open_dds::relationships::RelationshipName,\n        target_model_name: Qualified<open_dds::models::ModelName>,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' references a boolean expression type that cannot be found: '{boolean_expression_type}'\"\n    )]\n    ComparableRelationshipBooleanExpressionNotFound {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: open_dds::relationships::RelationshipName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\n        \"the boolean expression type '{boolean_expression_type}' used in the comparable relationship '{relationship_name}' does not have an object aggregate operand\"\n    )]\n    ComparableRelationshipBooleanExpressionIncorrectOperandType {\n        relationship_name: open_dds::relationships::RelationshipName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\n        \"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}'\"","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L310-L346","documentation":"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.","triggerScenarios":"Declaring a comparable relationship whose referenced boolean expression type (qualified CustomTypeName) is not defined anywhere in the resolved metadata.","commonSituations":"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.","solutions":["Correct the qualified boolean expression type name on the comparable relationship","Define/enable the missing boolean expression type for the target model's type","Ensure cross-subgraph type references point at types that are actually exported in that subgraph"],"exampleFix":"# before\ncomparableRelationship:\n  relationshipName: author\n  booleanExpressionType: author_filter   # actual type is author_bool_exp\n\n# after\ncomparableRelationship:\n  relationshipName: author\n  booleanExpressionType: author_bool_exp","handlingStrategy":"validation","validationCode":"for r in &comparable_relationships {\n    assert!(bool_exp_types.contains_key(&r.boolean_expression_type),\n        \"bool exp type {} not found\", r.boolean_expression_type);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate all booleanExpressionType references against defined types in CI","Generate metadata so relationship/type references stay in sync"],"tags":["rust","hasura","metadata","boolean-expression","type-not-found","relationships"],"backgroundTag":"type-not-found-in-schema","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}