hasura/graphql-engine · error · NDCValidationError

column {column_name} has type {column_type} in collection {c

Error message

column {column_name} has type {column_type} in collection {collection_name} in data connector {db_name}, not type {field_type}

What it means

A model's field mapping expects a specific NDC type, but the collection in the data connector reports a different type for that column. Type consistency between model field mappings and connector collections is enforced during resolution.

Source

Thrown at v3/crates/metadata-resolve/src/helpers/ndc_validation.rs:75

        procedure_name: ProcedureName,
    },
    #[error("function {function_name} is not defined in data connector {db_name}")]
    NoSuchFunction {
        db_name: Qualified<DataConnectorName>,
        command_name: Qualified<CommandName>,
        function_name: FunctionName,
    },
    #[error(
        "column {column_name} is not defined in function/procedure {func_proc_name} in data connector {db_name}"
    )]
    NoSuchColumnForCommand {
        db_name: Qualified<DataConnectorName>,
        command_name: Qualified<CommandName>,
        field_name: FieldName,
        func_proc_name: String,
        column_name: DataConnectorColumnName,
    },
    #[error(
        "column {column_name} has type {column_type} in collection {collection_name} in data connector {db_name}, not type {field_type}"
    )]
    ColumnTypeDoesNotMatch {
        db_name: DataConnectorName,
        model_name: ModelName,
        field_name: FieldName,
        collection_name: CollectionName,
        column_name: DataConnectorColumnName,
        field_type: String,
        column_type: String,
    },
    #[error(
        "internal error: data connector does not define the scalar type {type}, used by field {field_name} in model {model_name}"
    )]
    TypeCapabilityNotDefined {
        model_name: ModelName,
        field_name: FieldName,
        r#type: String,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Update the model's field mapping so the field type matches the collection column type reported by the connector
  2. Alter the database column back or add a cast so the connector reports the expected type
  3. If the connector's type mapping changed between versions, update the metadata's scalar representations accordingly

Example fix

# before
fields:
  age: { column: age, type: float }  # collection reports Int
# after
fields:
  age: { column: age, type: int }
Defensive patterns

Strategy: validation

Validate before calling

let ndc_ty = collection.columns.get(col).unwrap();
if ndc_ty != &expected_field_type { /* fail fast with clear message */ }

Prevention

When it happens

Trigger: Model maps a field to a collection column whose type differs (e.g. mapping a Float model field to an Int connector column); the database column type was altered (int -> bigint, varchar -> text) after the model was defined.

Common situations: Database schema migration changed a column type; connector version upgrade mapping types differently; mismatched scalar type representations between metadata and connector.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/aef87ae0cbe67891. Report an issue: GitHub.