{"record":{"id":"2f4bd2e32bf7003e","repo":"hasura/graphql-engine","slug":"the-field-field-name-in-type-name-should-hav","errorCode":null,"errorMessage":"the field {field_name:} in {type_name:} should have the type {expected:} for data connector {data_connector:} but the field has type {provided:}","messagePattern":"the field (.+?) in (.+?) should have the type (.+?) for data connector (.+?) but the field has type (.+?)","errorType":"validation","errorClass":"ObjectTypesIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/object_types/types.rs","lineNumber":466,"sourceCode":"        data_connector_name: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"Multiple {function_name} aggregate functions found for type {scalar_type} in data connector {data_connector_name}\"\n    )]\n    DuplicateAggregateFunctionsDefined {\n        scalar_type: ndc_models::ScalarTypeName,\n        function_name: String,\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"Multiple {function_name} extraction functions found for type {scalar_type} in data connector {data_connector_name}\"\n    )]\n    DuplicateExtractionFunctionsDefined {\n        scalar_type: ndc_models::ScalarTypeName,\n        function_name: String,\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"the field {field_name:} in {type_name:} should have the type {expected:} for data connector {data_connector:} but the field has type {provided:}\"\n    )]\n    FieldTypeMismatch {\n        field_name: FieldName,\n        type_name: Qualified<CustomTypeName>,\n        data_connector: Qualified<DataConnectorName>,\n        expected: QualifiedTypeName,\n        provided: QualifiedTypeName,\n    },\n    #[error(\n        \"Field type {field_type} could not be found in field {field_name} for object type {object_type_name}\"\n    )]\n    FieldTypeNotFound {\n        field_type: Qualified<CustomTypeName>,\n        object_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n    },\n    #[error(","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/object_types/types.rs#L448-L484","documentation":"A field on a custom object type has a declared type that differs from the type the resolver computed it should have for the given data connector. Expected vs provided are both printed as qualified type names, so the mismatch is usually visible directly in the message.","triggerScenarios":"A field mapping resolves to a different NDC type than the field's declared Hasura type — e.g. field declared as String while the connector column type maps to Int, or a nested object field whose mapped target type differs.","commonSituations":"Changing a column type in the database without updating metadata; mismatched type mappings in data_connector_scalar_type entries; connector version changing its type mapping for a scalar.","solutions":["Compare the expected/provided types in the message and update the field's type in the custom type definition to match","If the database column type changed, re-track the table / refresh the connector schema and update metadata accordingly","Align the data_connector_scalar_type mappings so the connector's type resolves to the declared Hasura type"],"exampleFix":"// before\n{\"field_name\":\"age\",\"type\":\"String\"} // column is int\n// after\n{\"field_name\":\"age\",\"type\":\"Int\"}","handlingStrategy":"validation","validationCode":"// Compare declared field type with the mapped NDC column type\nconst ndcType = ndcSchema.object_types[obj].fields[col]?.type;\nif (!typesCompatible(field.type, mapNdcType(ndcType))) throw new Error(`Field ${field.name} type mismatch`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate metadata after database column type changes","Map connector scalar types explicitly so expected/provided types agree"],"tags":["hasura","metadata","data-connectors","type-mismatch","field-mapping"],"backgroundTag":"type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}