{"record":{"id":"b4261d73bd50ba2a","repo":"hasura/graphql-engine","slug":"mapping-for-type-type-name-of-command-command-n","errorCode":null,"errorMessage":"mapping for type {type_name} of command {command_name} is not defined","messagePattern":"mapping for type (.+?) of command (.+?) is not defined","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":102,"sourceCode":"        field_type: String,\n        column_type: String,\n    },\n    #[error(\n        \"internal error: data connector does not define the scalar type {type}, used by field {field_name} in model {model_name}\"\n    )]\n    TypeCapabilityNotDefined {\n        model_name: ModelName,\n        field_name: FieldName,\n        r#type: String,\n    },\n    #[error(\"type {0} is not defined in the agent schema\")]\n    NoSuchType(String),\n    #[error(\"mapping for type {type_name} of model {model_name} is not defined\")]\n    UnknownModelTypeMapping {\n        model_name: Qualified<ModelName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\"mapping for type {type_name} of command {command_name} is not defined\")]\n    UnknownCommandTypeMapping {\n        command_name: Qualified<CommandName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"Field {field_name} for type {type_name} referenced in model {model_name} is not defined\"\n    )]\n    UnknownTypeField {\n        model_name: ModelName,\n        type_name: CustomTypeName,\n        field_name: FieldName,\n    },\n    #[error(\n        \"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:}\"\n    )]\n    FuncProcAndCommandScalarOutputTypeMismatch {\n        function_or_procedure_name: String,\n        function_or_procedure_output_type: String,","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L84-L120","documentation":"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.","triggerScenarios":"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.","commonSituations":"New command with structured output missing mapping; switching output type; inconsistent metadata after refactoring.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if command.output_is_custom_type() {\n    assert!(mappings.contains_key(&command_output_type));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair every command output type change with a mapping check"],"tags":["type-mapping","command","ndc"],"backgroundTag":"missing-type-mapping","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}