hasura/graphql-engine · error · ArgumentPresetExecutionError

no data connector field mapping found for field '{field_name

Error message

no data connector field mapping found for field '{field_name}' of object type '{object_type_name}'

What it means

FieldMappingNotFound is thrown when the planner looks for the data connector field mapping of a specific field on an object type and cannot find one. Field mappings associate a logical field name with the connector's column/property; this error means the field is known but has no mapping to the backend.

Source

Thrown at v3/crates/plan/src/query/arguments.rs:400

        role: Role,
        model_name: Qualified<ModelName>,
    },
    #[error("command {command_name} does not have a source defined")]
    CommandSourceNotFound {
        command_name: Qualified<CommandName>,
    },
    #[error("command permissions for command {command_name} not found for role {role}")]
    CommandArgumentPresetsNotFound {
        command_name: Qualified<CommandName>,
        role: Role,
    },
    #[error("argument mapping not found for {argument_name}")]
    ArgumentMappingNotFound { argument_name: ArgumentName },
    #[error("type mapping not found for object {object_type_name}")]
    TypeMappingNotFound {
        object_type_name: Qualified<CustomTypeName>,
    },
    #[error(
        "no data connector field mapping found for field '{field_name}' of object type '{object_type_name}'"
    )]
    FieldMappingNotFound {
        object_type_name: Qualified<CustomTypeName>,
        field_name: FieldName,
    },
    #[error(
        "no field definition found for field '{field_name}' of object type '{object_type_name}'"
    )]
    FieldDefinitionNotFound {
        object_type_name: Qualified<CustomTypeName>,
        field_name: FieldName,
    },
    #[error(
        "no data connector field mapping found for field '{field_name}' of object type '{object_type_name}'"
    )]
    DataConnectorFieldMappingNotFound {
        object_type_name: Qualified<CustomTypeName>,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add a field mapping for the named field on the named object type
  2. Check spelling/case of the field name in the query against metadata
  3. Sync field mappings with the current connector schema (introspect/regenerate)
  4. Reload metadata and retry

Example fix

// before
{"objectTypes":{"users":{"fields":{"email":{}}}}}
// after
{"objectTypes":{"users":{"fields":{"email":{"mapping":{"column":"email_address"}}}}}}
Defensive patterns

Strategy: validation

Validate before calling

fn field_mapping_exists(metadata: &Metadata, t: &Qualified<CustomTypeName>, f: &FieldName) -> bool {
    metadata.object_types.get(t)
        .and_then(|o| o.field_mappings.as_ref())
        .map(|m| m.contains_key(f)).unwrap_or(false)
}

Type guard

fn is_field_mapping_not_found(e: &ArgumentPresetExecutionError) -> bool {
    matches!(e, ArgumentPresetExecutionError::FieldMappingNotFound { .. })
}

Try / catch

match result {
    Err(PlanError::Arguments(ArgumentPresetExecutionError::FieldMappingNotFound { object_type_name, field_name })) => {
        bad_request(format!("no mapping for {field_name} on {object_type_name}"));
    }
    other => other,
}

Prevention

When it happens

Trigger: Selecting or mapping a field of an object type during argument/preset resolution when that field lacks a field mapping in metadata — e.g. a computed or newly added field with no backend column mapping.

Common situations: Adding a field to a type in the GraphQL schema without a corresponding mapping; renaming a column in the database without updating the field mapping; connector schema drift after upgrades.

Related errors


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