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
- Add the missing type mapping for the command's type on its data connector
- Check the command's output type spelling and qualification (subgraph prefix)
- 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
- Pair every command output type change with a mapping check
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
- the type {unknown_ndc_type:} is not defined as an object typ
- function {function_name} is not defined in data connector {d
- column {column_name} is not defined in function/procedure {f
- mapping for type {type_name} of model {model_name} is not de
- Result type of function/procedure {function_or_procedure_nam
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/b4261d73bd50ba2a.
Report an issue: GitHub.