hasura/graphql-engine · error · NDCValidationError

mapping for type {type_name} of model {model_name} is not de

Error message

mapping for type {type_name} of model {model_name} is not defined

What it means

A model uses a type for which no data connector type mapping is defined. During type-mapping collection, every custom type used by a model backed by a data connector must have an explicit mapping to an NDC object type.

Source

Thrown at v3/crates/metadata-resolve/src/helpers/ndc_validation.rs:97

        db_name: DataConnectorName,
        model_name: ModelName,
        field_name: FieldName,
        collection_name: CollectionName,
        column_name: DataConnectorColumnName,
        field_type: String,
        column_type: String,
    },
    #[error(
        "internal error: data connector does not define the scalar type {type}, used by field {field_name} in model {model_name}"
    )]
    TypeCapabilityNotDefined {
        model_name: ModelName,
        field_name: FieldName,
        r#type: String,
    },
    #[error("type {0} is not defined in the agent schema")]
    NoSuchType(String),
    #[error("mapping for type {type_name} of model {model_name} is not defined")]
    UnknownModelTypeMapping {
        model_name: Qualified<ModelName>,
        type_name: Qualified<CustomTypeName>,
    },
    #[error("mapping for type {type_name} of command {command_name} is not defined")]
    UnknownCommandTypeMapping {
        command_name: Qualified<CommandName>,
        type_name: Qualified<CustomTypeName>,
    },
    #[error(
        "Field {field_name} for type {type_name} referenced in model {model_name} is not defined"
    )]
    UnknownTypeField {
        model_name: ModelName,
        type_name: CustomTypeName,
        field_name: FieldName,
    },
    #[error(

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add a type mapping for the type to the relevant data connector in metadata
  2. Verify the mapping's data connector name matches the one used by the model
  3. If the type should not be mapped, remove the field referencing it from the model

Example fix

# before
# model uses type app.Address but no mapping defined
# after
kind: DataConnectorLink
...
typeMappings:
  app.Address:
    ndcTypeName: address
Defensive patterns

Strategy: validation

Validate before calling

assert!(type_mappings.contains_key(&(model.data_connector.clone(), type_name)));
// or ensure mapping exists before adding nested fields

Prevention

When it happens

Trigger: A model's field uses a custom object type but the metadata lacks a type mapping for that type against the model's data connector; adding a nested object field without the corresponding type mapping block.

Common situations: Adding nested/relationship object types without defining typeMappings; moving a model to a different data connector without adding mappings there; partial metadata authored by hand.

Related errors


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