{"record":{"id":"e6a9ce8d11ecd745","repo":"hasura/graphql-engine","slug":"the-boolean-expression-type-with-name-type-name","errorCode":null,"errorMessage":"the boolean expression type with name {type_name} is defined more than once","messagePattern":"the boolean expression type with name (.+?) is defined more than once","errorType":"validation","errorClass":"BooleanExpressionIssue::DuplicateBooleanExpressionType","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs","lineNumber":82,"sourceCode":"        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    )]\n    MultidimensionalArrayComparableFieldNotSupported {\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"the target model '{target_model_name}' of the relationship '{relationship_name}' does not have a boolean expression type defined\"\n    )]\n    ComparableRelationshipToModelWithoutBooleanExpressionType {\n        target_model_name: Qualified<ModelName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\"the boolean expression type with name {type_name} is defined more than once\")]\n    DuplicateBooleanExpressionType {\n        type_name: Qualified<CustomTypeName>,\n    },\n}\n\nimpl ContextualError for BooleanExpressionIssue {\n    fn create_error_context(&self) -> Option<error_context::Context> {\n        None\n    }\n}\n\nimpl ShouldBeAnError for BooleanExpressionIssue {\n    fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            BooleanExpressionIssue::DataConnectorDoesNotSupportNestedObjectArrayFiltering {\n                ..\n            } => flags.contains(open_dds::flags::Flag::RequireNestedArrayFilteringCapability),\n            BooleanExpressionIssue::DataConnectorDoesNotSupportNestedScalarArrayFiltering {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs#L64-L100","documentation":"DuplicateBooleanExpressionType is thrown when two boolean expression type definitions share the same qualified type name in the metadata. Since boolean expression types become named GraphQL input types, name collisions are ambiguous and rejected during the resolve stage.","triggerScenarios":"Declaring two BooleanExpressionType entries (across models or in different subgraphs/agent modules) whose Qualified<CustomTypeName> resolves to the same name, then running metadata resolution.","commonSituations":"Copying a model's boolean expression config into a new agent/microservices dir without renaming; adding a boolean expression type to two models that target the same object type with the same explicit name; merging metadata from multiple teams where each defined 'X_bool_exp'.","solutions":["Rename one of the duplicate boolean expression types so each Qualified name is unique (e.g. prefix with the model or agent name)","Check for the same type name defined in multiple metadata files/agents and remove the redundant definition","If the duplicate comes from multiple subgraphs, ensure each subgraph's type names are namespace-qualified"],"exampleFix":"// before\nbooleanExpressionTypes:\n  - name: user_bool_exp   # defined in agent A\n  - name: user_bool_exp   # defined in agent B\n\n// after\nbooleanExpressionTypes:\n  - name: agent_a_user_bool_exp\n  - name: agent_b_user_bool_exp","handlingStrategy":"validation","validationCode":"fn assert_unique_be_type_names(types: &[BooleanExpressionType]) -> Result<(), String> {\n    let mut seen = HashSet::new();\n    for t in types {\n        if !seen.insert(t.name.clone()) {\n            return Err(format!(\"duplicate boolean expression type: {}\", t.name));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"Match DuplicateBooleanExpressionType { type_name } from the resolve error and report the colliding name to surface which metadata files to dedupe.","preventionTips":["Namespace boolean expression type names per model/agent","Run a uniqueness lint over all type names before metadata resolution","Use codegen with central name allocation so names cannot collide"],"tags":["hasura","metadata","duplicate","boolean-expression","naming"],"backgroundTag":"duplicate-type-definition","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}