hasura/graphql-engine · error · BooleanExpressionIssue::DuplicateBooleanExpressionType
the boolean expression type with name {type_name} is defined
Error message
the boolean expression type with name {type_name} is defined more than once What it means
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.
Source
Thrown at v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs:82
name_source_1: FieldNameSource,
name_source_2: FieldNameSource,
},
#[error(
"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"
)]
MultidimensionalArrayComparableFieldNotSupported {
boolean_expression_type_name: Qualified<CustomTypeName>,
field_name: FieldName,
field_type: QualifiedTypeReference,
},
#[error(
"the target model '{target_model_name}' of the relationship '{relationship_name}' does not have a boolean expression type defined"
)]
ComparableRelationshipToModelWithoutBooleanExpressionType {
target_model_name: Qualified<ModelName>,
relationship_name: RelationshipName,
},
#[error("the boolean expression type with name {type_name} is defined more than once")]
DuplicateBooleanExpressionType {
type_name: Qualified<CustomTypeName>,
},
}
impl ContextualError for BooleanExpressionIssue {
fn create_error_context(&self) -> Option<error_context::Context> {
None
}
}
impl ShouldBeAnError for BooleanExpressionIssue {
fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {
match self {
BooleanExpressionIssue::DataConnectorDoesNotSupportNestedObjectArrayFiltering {
..
} => flags.contains(open_dds::flags::Flag::RequireNestedArrayFilteringCapability),
BooleanExpressionIssue::DataConnectorDoesNotSupportNestedScalarArrayFiltering {View on GitHub (pinned to 724551b9ae)
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
Example fix
// before booleanExpressionTypes: - name: user_bool_exp # defined in agent A - name: user_bool_exp # defined in agent B // after booleanExpressionTypes: - name: agent_a_user_bool_exp - name: agent_b_user_bool_exp
Defensive patterns
Strategy: validation
Validate before calling
fn assert_unique_be_type_names(types: &[BooleanExpressionType]) -> Result<(), String> {
let mut seen = HashSet::new();
for t in types {
if !seen.insert(t.name.clone()) {
return Err(format!("duplicate boolean expression type: {}", t.name));
}
}
Ok(())
} Try / catch
Match DuplicateBooleanExpressionType { type_name } from the resolve error and report the colliding name to surface which metadata files to dedupe. Prevention
- 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
When it happens
Trigger: Declaring two BooleanExpressionType entries (across models or in different subgraphs/agent modules) whose Qualified<CustomTypeName> resolves to the same name, then running metadata resolution.
Common situations: 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'.
Related errors
- the following command is defined more than once: {name:}
- error fetching config from server: %w
- error fetching server config: %v
- Cannot add query root field {0} as it already in use
- Cannot add mutation root field {0} as it already in use
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/e6a9ce8d11ecd745.
Report an issue: GitHub.