{"record":{"id":"9ef20c4d69e065b0","repo":"hasura/graphql-engine","slug":"the-comparable-relationship-name-is-defined-mo","errorCode":null,"errorMessage":"the comparable relationship '{name}' is defined more than once in the boolean expression type '{type_name}'","messagePattern":"the comparable relationship '(.+?)' is defined more than once in the boolean expression type '(.+?)'","errorType":"validation","errorClass":"BooleanExpressionIssue::DuplicateComparableRelationshipFound","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs","lineNumber":51,"sourceCode":"        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"The data connector '{data_connector_name}' does not support filtering by nested scalar arrays. The comparable field '{field_name}' within '{boolean_expression_type_name}' is of a scalar array type: {field_type}\"\n    )]\n    DataConnectorDoesNotSupportNestedScalarArrayFiltering {\n        data_connector_name: Qualified<DataConnectorName>,\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"the comparable field '{name}' is defined more than once in the boolean expression type '{type_name}'\"\n    )]\n    DuplicateComparableFieldFound {\n        type_name: Qualified<CustomTypeName>,\n        name: FieldName,\n    },\n    #[error(\n        \"the comparable relationship '{name}' is defined more than once in the boolean expression type '{type_name}'\"\n    )]\n    DuplicateComparableRelationshipFound {\n        type_name: Qualified<CustomTypeName>,\n        name: RelationshipName,\n    },\n    #[error(\n        \"the boolean expression '{type_name}' has a GraphQL field name conflict between the '{name}' {name_source_1} and the '{name}' {name_source_2}. One of these will need to be renamed.\"\n    )]\n    GraphqlFieldNameConflict {\n        type_name: Qualified<CustomTypeName>,\n        name: String,\n        name_source_1: FieldNameSource,\n        name_source_2: FieldNameSource,\n    },\n    #[error(\n        \"the type of the comparable field '{field_name}' on the boolean expresssion '{boolean_expression_type_name}' is a multidimensional array type: {field_type}. Multidimensional arrays are not supported in boolean expressions\"\n    )]","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs#L33-L69","documentation":"The same comparable relationship name is declared more than once in a boolean expression type. Relationship names within a boolean expression must be unique.","triggerScenarios":"Listing the same relationship name twice among a boolean expression type's comparable relationships, typically via duplicated metadata blocks.","commonSituations":"Hand-edited HML where a relationship block was pasted twice; merging subgraph metadata that both define the same relationship name on the boolean expression type.","solutions":["Remove the duplicate relationship entry with that `name`","Rename one of the relationships if two distinct ones were intended","Validate metadata files for duplicate keys before applying"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let mut seen = HashSet::new();\nfor r in &be_type.comparable_relationships {\n    if !seen.insert(r.name.clone()) {\n        return Err(format!(\"duplicate comparable relationship {}\", r.name));\n    }\n}","typeGuard":"fn has_duplicate_relationships(rels: &[ComparableRelationship]) -> bool {\n    let mut s = HashSet::new();\n    rels.iter().any(|r| !s.insert(r.name.clone()))\n}","tryCatchPattern":"if let BooleanExpressionIssue::DuplicateComparableRelationshipFound { type_name, name } = &issue {\n    eprintln!(\"remove the duplicate relationship '{name}' in {type_name}\");\n}","preventionTips":["Deduplicate metadata after merging subgraphs","Validate uniqueness of relationship names per boolean expression type"],"tags":["rust","hasura","metadata","boolean-expressions","relationships","duplicate-key"],"backgroundTag":"duplicate-field-definition","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}