{"record":{"id":"f9d13f62e293c1e9","repo":"hasura/graphql-engine","slug":"mapping-for-type-type-name-of-model-model-name","errorCode":null,"errorMessage":"mapping for type {type_name} of model {model_name} is not defined","messagePattern":"mapping for type (.+?) of model (.+?) is not defined","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":97,"sourceCode":"        db_name: DataConnectorName,\n        model_name: ModelName,\n        field_name: FieldName,\n        collection_name: CollectionName,\n        column_name: DataConnectorColumnName,\n        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(","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L79-L115","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a type mapping for the type to the relevant data connector in metadata","Verify the mapping's data connector name matches the one used by the model","If the type should not be mapped, remove the field referencing it from the model"],"exampleFix":"# before\n# model uses type app.Address but no mapping defined\n# after\nkind: DataConnectorLink\n...\ntypeMappings:\n  app.Address:\n    ndcTypeName: address","handlingStrategy":"validation","validationCode":"assert!(type_mappings.contains_key(&(model.data_connector.clone(), type_name)));\n// or ensure mapping exists before adding nested fields","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever adding a nested object field, add its type mapping in the same change"],"tags":["type-mapping","ndc","model"],"backgroundTag":"missing-type-mapping","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}