{"record":{"id":"52371df94b80c7c8","repo":"hasura/graphql-engine","slug":"the-type-unknown-ndc-type-is-not-defined-as-an","errorCode":null,"errorMessage":"the type {unknown_ndc_type:} is not defined as an object type in the connector's schema. This type is being mapped to by the type {type_name:} used in argument {argument_name:} which is mapped to the data connector argument {ndc_argument_name:}","messagePattern":"the type (.+?) is not defined as an object type in the connector's schema\\. This type is being mapped to by the type (.+?) used in argument (.+?) which is mapped to the data connector argument (.+?)","errorType":"validation","errorClass":"ArgumentMappingError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/argument.rs","lineNumber":64,"sourceCode":"    #[error(\"the mapping for argument {argument_name:} has been defined more than once\")]\n    DuplicateCommandArgumentMapping { argument_name: ArgumentName },\n    #[error(\"the data connector argument {ndc_argument_name} has been mapped to more than once\")]\n    DuplicateNdcArgumentMapping {\n        ndc_argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"the argument {argument_name} is mapped to the data connector argument {ndc_argument_name} which is already used as an argument preset in the DataConnectorLink\"\n    )]\n    ArgumentAlreadyPresetInDataConnectorLink {\n        argument_name: ArgumentName,\n        ndc_argument_name: DataConnectorArgumentName,\n    },\n    #[error(\"{argument_name:} has the data type {data_type:} that has not been defined\")]\n    UnknownType {\n        argument_name: ArgumentName,\n        data_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"the type {unknown_ndc_type:} is not defined as an object type in the connector's schema. This type is being mapped to by the type {type_name:} used in argument {argument_name:} which is mapped to the data connector argument {ndc_argument_name:}\"\n    )]\n    UnknownNdcType {\n        argument_name: ArgumentName,\n        ndc_argument_name: DataConnectorArgumentName,\n        type_name: Qualified<CustomTypeName>,\n        unknown_ndc_type: String,\n    },\n    #[error(\"ndc validation error: {0}\")]\n    NDCValidationError(NDCValidationError),\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum ArgumentMappingIssue {\n    #[error(\n        \"the following data connector arguments are not mapped to an argument: {}\",\n        ndc_argument_names.join(\", \")\n    )]","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/argument.rs#L46-L82","documentation":"During NDC validation of command/field arguments, the metadata maps a custom object type (type_name) to an NDC type (unknown_ndc_type) that the data connector's schema response does not define as an object type. The resolver checks every type mapping against the connector's /schema capabilities; an object-type mapping to a nonexistent or non-object NDC type raises this error.","triggerScenarios":"A TypeToNdcTypeMapping (or command argument type mapping) points at an NDC object type name that the connector no longer exposes; the connector's schema changed between environments; the mapping string has a typo or wrong capitalization; the connector returns scalar/array types where an object was expected.","commonSituations":"Connector upgraded and renamed/dropped an object type; environment drift between dev and prod connector schemas; hand-written type mappings in metadata; using a connector whose schema response is incomplete or stale.","solutions":["Fetch the connector's current schema (its /schema endpoint or capabilities) and confirm the exact NDC type name exists and is an object type","Update the type mapping in metadata to the correct current NDC type name","If the connector should expose the type, fix the connector or its configuration and refetch the schema","Re-run metadata resolve/build after corrections"],"exampleFix":"// before\n\"type_mappings\": [{ \"type_name\": \"my_subgraph.User\", \"ndc_type\": \"Usr\" }]\n// after\n\"type_mappings\": [{ \"type_name\": \"my_subgraph.User\", \"ndc_type\": \"User\" }]","handlingStrategy":"validation","validationCode":"let schema = connector_client.get_schema().await?;\nlet obj_types: HashSet<&str> = schema.object_types.keys().map(String::as_str).collect();\nfor m in &type_mappings {\n    assert!(obj_types.contains(m.ndc_type.as_str()),\n        \"NDC object type {} not found in connector schema\", m.ndc_type);\n}","typeGuard":"fn ndc_object_type_exists(name: &str, schema: &NdcSchema) -> bool {\n    schema.object_types.contains_key(name)\n}","tryCatchPattern":"Catch UnknownNdcType during resolve and report the mapping triple (type_name -> unknown_ndc_type) with a hint to refetch the connector schema.","preventionTips":["Pin connector versions in all environments","Regenerate/refresh connector schema after connector upgrades","Automate a diff of connector schema vs type mappings in CI"],"tags":["ndc","schema-validation","type-mapping","data-connectors"],"backgroundTag":"schema-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}