{"record":{"id":"05a67a2833c2858f","repo":"hasura/graphql-engine","slug":"the-type-unknown-ndc-type-is-not-defined-as-an-05a67a","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:}","messagePattern":"the type (.+?) is not defined as an object type in the connector's schema\\. This type is being mapped to by the type (.+?)","errorType":"validation","errorClass":"TypeMappingValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/object_types/error.rs","lineNumber":120,"sourceCode":"        field_name: FieldName,\n    },\n    #[error(\n        \"the type {unknown_field_type_name:} referenced by the field {field_name:} in type {type_name:} has not been defined\"\n    )]\n    UnknownFieldType {\n        type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        unknown_field_type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"could not find mappings for {object_type_name:} to the {data_connector_object_type:} on data connector {data_connector_name:}\"\n    )]\n    DataConnectorTypeMappingNotFound {\n        object_type_name: Qualified<CustomTypeName>,\n        data_connector_name: Qualified<DataConnectorName>,\n        data_connector_object_type: DataConnectorObjectType,\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:}\"\n    )]\n    UnknownNdcType {\n        type_name: Qualified<CustomTypeName>,\n        unknown_ndc_type: DataConnectorObjectType,\n    },\n    #[error(\"expected to find a predicate type for argument {argument_name:} but did not\")]\n    PredicateTypeNotFound { argument_name: ArgumentName },\n    #[error(\n        \"the type {unknown_ndc_field_type_name:} is not defined as an object type in the connector's schema. This type is referenced by the field {ndc_field_name:} in the connector's schema type {ndc_type_name:}, which is mapped to the field {field_name:} in the type {type_name:}\"\n    )]\n    UnknownNdcFieldObjectType {\n        type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        ndc_type_name: String,\n        ndc_field_name: String,\n        unknown_ndc_field_type_name: String,\n    },","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/object_types/error.rs#L102-L138","documentation":"Thrown during metadata resolution when a Hasura custom type maps to a data connector object type name that does not exist in the connector's NDC schema. The resolver fetched the connector's schema (via its capabilities/schema endpoint) and could not find the declared NDC type name, so the mapping from the custom type cannot be honored.","triggerScenarios":"Defining a CustomTypes object type with a data_connector_object_type mapping whose NDC type name is misspelled, was renamed in the connector, or the connector schema was fetched from a stale/different connector; e.g. mapping 'User' to 'users' when the connector exposes 'User' or 'user_table'.","commonSituations":"Typo in the ndc object type name in metadata; connector upgraded and renamed table/type names; pointing metadata at a different connector data source; connector schema endpoint returning fewer types than expected (permissions or filtered schema).","solutions":["Verify the exact object type name in the connector's NDC schema response (e.g. query the connector's /schema) and correct data_connector_object_type in the metadata","Check that the metadata's data source URL points at the connector instance whose schema actually contains this type","If the connector was upgraded/renamed types, update the metadata mappings to the new names","Regenerate/refresh the tracked tables so the connector schema and metadata stay in sync"],"exampleFix":"// before\n{\"object_type_name\":\"users\",\"data_connector_object_type\":\"user\"}\n// after\n{\"object_type_name\":\"users\",\"data_connector_object_type\":\"users\"}","handlingStrategy":"validation","validationCode":"// Before applying metadata, check the connector's schema for the type name\nconst ndcSchema = await fetch(`${connectorUrl}/schema`).then(r => r.json());\nconst ok = Object.keys(ndcSchema.object_types ?? {}).includes(metadataType.data_connector_object_type);\nif (!ok) throw new Error(`NDC type '${metadataType.data_connector_object_type}' not in connector schema`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fetch and cache the connector's /schema response before writing type mappings","Automate metadata generation from the connector schema instead of hand-writing type names","Run metadata validation (e.g. hasura metadata ic apply / dry-run) in CI before applying"],"tags":["hasura","metadata","data-connectors","ndc","type-mapping"],"backgroundTag":"type-mapping-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}