{"record":{"id":"2ad9313c7faeab00","repo":"hasura/graphql-engine","slug":"the-source-data-connector-data-connector-for-ty","errorCode":null,"errorMessage":"the source data connector {data_connector:} for type {type_name:} has not been defined","messagePattern":"the source data connector (.+?) for type (.+?) has not been defined","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":432,"sourceCode":"        \"unknown field '{field_name}' for type '{type_name}' used in target mapping for relationship '{relationship_name}'\"\n    )]\n    UnknownFieldInModelRelationshipTargetMapping {\n        field_name: FieldName,\n        type_name: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\"boolean expression '{boolean_expression_name:}' not found\")]\n    BooleanExpressionNotFound {\n        boolean_expression_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"field '{field_name:}' could not be found in boolean expression type for object type '{type_name:}'\"\n    )]\n    BooleanExpressionFieldNotFound {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"the source data connector {data_connector:} for type {type_name:} has not been defined\"\n    )]\n    UnknownTypeDataConnector {\n        type_name: Qualified<CustomTypeName>,\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison has the unknown NDC type '{ndc_type_name}' and therefore cannot be compared to a single value\"\n    )]\n    UnsupportedFieldComparisonToUnknownType {\n        field_name: Spanned<FieldName>,\n        field_type: QualifiedTypeReference,\n        type_name: Qualified<CustomTypeName>,\n        ndc_type_name: ndc_models::TypeName,\n    },\n\n    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison is an array type and therefore cannot be compared to a single value\"","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L414-L450","documentation":"The type's source is configured to use a data connector that has not been defined in metadata. Every model/type that is backed by a data source must reference a data connector declared at the subgraph level; an undeclared connector name fails resolution.","triggerScenarios":"Setting a model's `dataConnectorName` (source) to a connector that isn't declared under `data_connectors`; renaming a connector without updating model sources; missing connector definition after splitting metadata files.","commonSituations":"Env-specific metadata where the connector is defined in a different file that wasn't loaded; typos in the qualified connector name; migrating between connector versions that renamed the connector.","solutions":["Check `data_connector` in the message and declare a data connector with exactly that qualified name in the same subgraph","Update the model's source to reference the existing connector name","Verify the subgraph prefix in the qualified name matches where the connector is declared","Ensure all metadata files defining connectors are included when building the subgraph"],"exampleFix":"# before\ndata_connectors: {}\nmodels:\n  users:\n    source: {dataConnectorName: postgres}   # undefined\n# after\ndata_connectors:\n  postgres:\n    uri: {file: ./connectors/postgres/config.json}\nmodels:\n  users:\n    source: {dataConnectorName: postgres}\n","handlingStrategy":"validation","validationCode":"// Verify the connector is declared before resolving\nif !metadata.data_connectors.contains_key(&data_connector_name) {\n    return Err(format!(\"data connector {data_connector_name} not defined\"));\n}","typeGuard":"fn connector_defined<'a>(md: &'a Metadata, n: &Qualified<DataConnectorName>) -> Option<&'a DataConnectorLink> {\n    md.data_connectors.get(n)\n}","tryCatchPattern":"if let Err(Error::UnknownTypeDataConnector { type_name, data_connector }) = result {\n    return Err(format!(\"declare connector {data_connector} for {type_name}'s source\"));\n}","preventionTips":["Declare all connectors in the same build as the models that use them","Use a single source of truth for connector names across environments"],"tags":["metadata","data-connector","source","configuration","hasura"],"backgroundTag":"data-connector-not-defined","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}