hasura/graphql-engine · error · NDCValidationError

mapping for type {type_name} of command {command_name} is no

Error message

mapping for type {type_name} of command {command_name} is not defined

What it means

A command references a custom type in its output/argument shape that has no type mapping to the data connector. Commands backed by functions/procedures need mappings for every custom type they expose, analogous to models.

Source

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

        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(
        "Result type of function/procedure {function_or_procedure_name:} is {function_or_procedure_output_type:} but output type of command {command_name:} is {command_output_type:}"
    )]
    FuncProcAndCommandScalarOutputTypeMismatch {
        function_or_procedure_name: String,
        function_or_procedure_output_type: String,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add the missing type mapping for the command's type on its data connector
  2. Check the command's output type spelling and qualification (subgraph prefix)
  3. Align the command definition and type mapping in the same change
Defensive patterns

Strategy: validation

Validate before calling

if command.output_is_custom_type() {
    assert!(mappings.contains_key(&command_output_type));
}

Prevention

When it happens

Trigger: Defining a command returning an object type without a typeMapping for that type on the command's data connector; changing a command's output type without updating mappings.

Common situations: New command with structured output missing mapping; switching output type; inconsistent metadata after refactoring.

Related errors


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