{"record":{"id":"74391c05426daaa8","repo":"hasura/graphql-engine","slug":"the-relationship-relationship-name-is-defined","errorCode":null,"errorMessage":"the relationship '{relationship_name}' is defined more than once in the comparable relationships","messagePattern":"the relationship '(.+?)' is defined more than once in the comparable relationships","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":288,"sourceCode":"    )]\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}'\"\n    )]\n    ComparableRelationshipNotFound {\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 command. This is not supported\"\n    )]\n    ComparableRelationshipCommandTargetNotSupported {","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L270-L306","documentation":"When collecting the comparable relationships for a boolean expression type's aggregation support, the same relationship name appears more than once. Duplicate declarations make the generated aggregation input ambiguous, so the resolver rejects them.","triggerScenarios":"Two comparable relationship entries in the metadata share the same RelationshipName for the same operand type (e.g. duplicated entries in a list of comparable relationships).","commonSituations":"Copy-pasting comparable relationship entries and forgetting to rename them; YAML merge keys or anchors accidentally duplicating entries; merging metadata from multiple files that both declare the same relationship as comparable.","solutions":["Find the duplicated relationship_name in the comparable relationships list and remove or rename the duplicate","Check YAML anchors/merge keys for accidental duplication","If metadata is generated, fix the generator so it emits each comparable relationship exactly once"],"exampleFix":"# before\ncomparableRelationships:\n  - relationshipName: author\n  - relationshipName: author   # duplicate\n\n# after\ncomparableRelationships:\n  - relationshipName: author\n  - relationshipName: reviews","handlingStrategy":"validation","validationCode":"let names: HashSet<_> = comparable_relationships.iter().map(|r| &r.relationship_name).collect();\nassert_eq!(names.len(), comparable_relationships.len(), \"duplicate comparable relationship\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run a duplicate-key check over all metadata lists in CI","Avoid YAML anchors that copy entries verbatim"],"tags":["rust","hasura","metadata","duplicate","relationships"],"backgroundTag":"duplicate-definition-in-config","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}