hasura/graphql-engine · error · DataConnectorScalarTypesError::DuplicateDataConnectorScalarRepresentation
multiple type representations defined for scalar {scalar_typ
Error message
multiple type representations defined for scalar {scalar_type:} from data connector {data_connector:} What it means
A data connector scalar type has multiple conflicting type representations defined in metadata. Only one representation per (connector, scalar) pair is allowed so the scalar's GraphQL/SQL mapping is unambiguous.
Source
Thrown at v3/crates/metadata-resolve/src/stages/data_connector_scalar_types/error.rs:18
use open_dds::types::CustomTypeName;
use open_dds::data_connector::{DataConnectorName, DataConnectorScalarType};
use crate::types::error::ContextualError;
use crate::types::subgraph::Qualified;
use crate::stages::{graphql_config, scalar_boolean_expressions};
impl ContextualError for DataConnectorScalarTypesError {
fn create_error_context(&self) -> Option<error_context::Context> {
None
}
}
#[derive(Debug, thiserror::Error)]
pub enum DataConnectorScalarTypesError {
#[error(
"multiple type representations defined for scalar {scalar_type:} from data connector {data_connector:}"
)]
DuplicateDataConnectorScalarRepresentation {
data_connector: Qualified<DataConnectorName>,
scalar_type: DataConnectorScalarType,
},
#[error("unknown type represented for scalar type {scalar_type:}: {type_name:}")]
ScalarTypeUnknownRepresentation {
scalar_type: DataConnectorScalarType,
type_name: Qualified<CustomTypeName>,
},
#[error("{0}")]
GraphqlConfigError(#[from] graphql_config::GraphqlConfigError),
#[error("{0}")]
ScalarBooleanExpressionTypeError(
#[from] scalar_boolean_expressions::ScalarBooleanExpressionTypeError,
),
}View on GitHub (pinned to 724551b9ae)
Solutions
- Find duplicate scalar definitions for the connector
- Keep exactly one representation and delete or merge the others
- Rebuild metadata
Defensive patterns
Strategy: validation
Validate before calling
// Key scalar representations by (connector, scalar) and assert no duplicates
let mut seen = HashSet::new();
for (conn, scalar, _repr) in reps { assert!(seen.insert((conn, scalar))); } Try / catch
Catch DuplicateDataConnectorScalarRepresentation and report the connector/scalar pair.
Prevention
- Keep scalar definitions in one place per connector
- Lint for duplicate scalar blocks when merging metadata
When it happens
Trigger: Defining the same DataConnectorScalarType with more than one type representation under the same data connector.
Common situations: Merging metadata files that both define the same connector scalar with different representations; copy-paste of scalar blocks.
Related errors
- the data connector is defined more than once
- Data connector {data_connector_name} is referenced by multip
- unknown data connector {data_connector:} referenced in scala
- scalar representations for data connector {data_connector:}
- cannot get absolute path: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/6b462ffb0b1fca78.
Report an issue: GitHub.