hasura/graphql-engine · error · TypeMappingCollectionError

No mapping defined for type {type_name:} to object {ndc_type

Error message

No mapping defined for type {type_name:} to object {ndc_type_name:} of data connector {data_connector:}

What it means

No type mapping exists for a custom type to the given NDC object type of the data connector. Raised while collecting type mappings when a type is expected to map to an object but no mapping was found.

Source

Thrown at v3/crates/metadata-resolve/src/helpers/type_mappings.rs:19

use crate::stages::{object_types, scalar_types, type_permissions};

use crate::data_connectors::CommandsResponseConfig;
use crate::helpers::ndc_validation::{NDCValidationError, get_underlying_named_type};
use crate::helpers::types::{object_type_exists, unwrap_custom_type_name};
use crate::types::subgraph::Qualified;
use open_dds::data_connector::{DataConnectorName, DataConnectorObjectType};
use open_dds::types::{CustomTypeName, FieldName};
use std::collections::BTreeMap;

#[derive(Debug)]
pub struct TypeMappingToCollect<'a> {
    pub type_name: &'a Qualified<CustomTypeName>,
    pub ndc_object_type_name: &'a ndc_models::TypeName,
}

#[derive(thiserror::Error, Debug)]
pub enum TypeMappingCollectionError {
    #[error(
        "No mapping defined for type {type_name:} to object {ndc_type_name:} of data connector {data_connector:}"
    )]
    MappingNotDefined {
        type_name: Qualified<CustomTypeName>,
        data_connector: Qualified<DataConnectorName>,
        ndc_type_name: DataConnectorObjectType,
    },
    #[error(
        "No support for using the same type {type_name:} against multiple data connector objects {ndc_type_1:} and {ndc_type_2:}"
    )]
    MappingToMultipleDataConnectorObjectType {
        type_name: Qualified<CustomTypeName>,
        ndc_type_1: DataConnectorObjectType,
        ndc_type_2: DataConnectorObjectType,
    },
    #[error(
        "Missing mapping for field {field_name:} when mapping type {type_name:} to object {ndc_type_name:} of data connector {data_connector:}"
    )]

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add the type mapping for the type to that data connector object
  2. Verify type and data connector names (including subgraph qualification) are spelled exactly
  3. Remove usages of the type if mapping is not intended
Defensive patterns

Strategy: validation

Validate before calling

assert!(mappings.lookup(type_name, data_connector).is_some());

Prevention

When it happens

Trigger: A relationship/nested type resolves to an object usage on a connector with no mapping recorded; partially authored typeMappings.

Common situations: Adding nested object usages without mappings; refactoring type names without updating mappings; connector switch leaving old mappings only.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/e843440cb185125a. Report an issue: GitHub.