hasura/graphql-engine · error · ArgumentMappingError

{argument_name:} has the data type {data_type:} that has not

Error message

{argument_name:} has the data type {data_type:} that has not been defined

What it means

Thrown by metadata-resolve when an argument (on a command or object field mapped to a data connector) references a custom type via Qualified<CustomTypeName> that is not defined anywhere in the metadata's type definitions (scalar/object type maps). During resolution every argument type must resolve to a known type; if the Qualified reference has no corresponding entry, resolution fails with this error. It typically means the type was renamed, deleted, or lives in a different subgraph.

Source

Thrown at v3/crates/metadata-resolve/src/helpers/argument.rs:59

    #[error("argument {argument_name:} is mapped to an unknown argument {ndc_argument_name:}")]
    UnknownNdcArgument {
        argument_name: ArgumentName,
        ndc_argument_name: DataConnectorArgumentName,
    },
    #[error("the mapping for argument {argument_name:} has been defined more than once")]
    DuplicateCommandArgumentMapping { argument_name: ArgumentName },
    #[error("the data connector argument {ndc_argument_name} has been mapped to more than once")]
    DuplicateNdcArgumentMapping {
        ndc_argument_name: DataConnectorArgumentName,
    },
    #[error(
        "the argument {argument_name} is mapped to the data connector argument {ndc_argument_name} which is already used as an argument preset in the DataConnectorLink"
    )]
    ArgumentAlreadyPresetInDataConnectorLink {
        argument_name: ArgumentName,
        ndc_argument_name: DataConnectorArgumentName,
    },
    #[error("{argument_name:} has the data type {data_type:} that has not been defined")]
    UnknownType {
        argument_name: ArgumentName,
        data_type: Qualified<CustomTypeName>,
    },
    #[error(
        "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:} used in argument {argument_name:} which is mapped to the data connector argument {ndc_argument_name:}"
    )]
    UnknownNdcType {
        argument_name: ArgumentName,
        ndc_argument_name: DataConnectorArgumentName,
        type_name: Qualified<CustomTypeName>,
        unknown_ndc_type: String,
    },
    #[error("ndc validation error: {0}")]
    NDCValidationError(NDCValidationError),
}

#[derive(Debug, thiserror::Error)]

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Find the argument named in the error and check its declared type's namespace and name against the types defined in your metadata (or the extension that should provide it)
  2. If the type was renamed or moved, update the argument's type reference to the correct Qualified name
  3. If the type should come from another subgraph, verify the subgraph/extension is enabled and its types are exported
  4. Define the missing custom type (scalar or object type) in metadata so the reference resolves

Example fix

// before
{
  "name": "my_command",
  "arguments": { "filter": { "type": "other_subgraph.MissingType" } }
}
// after
{
  "name": "my_command",
  "arguments": { "filter": { "type": "other_subgraph.ExistingType" } }
}
Defensive patterns

Strategy: validation

Validate before calling

let defined: HashSet<_> = metadata.types.keys().collect();
for (arg_name, arg) in &command.arguments {
    if let Type::Qualified(q) = &arg.type_ref {
        assert!(defined.contains(q), "argument {arg_name} references undefined type {q}");
    }
}

Type guard

fn type_is_defined(t: &Qualified<CustomTypeName>, types: &TypeMap) -> bool {
    types.get(t).is_some()
}

Try / catch

Match on the resolution error variant UnknownType and surface the argument_name and data_type to the user instead of a generic failure.

Prevention

When it happens

Trigger: An argument's type is set to a Qualified custom type name (e.g. "other_subgraph.MyType") that does not exist in the resolved subgraph/connector schema; building/resolving metadata that references a type removed in a refactor or provided by an extension that is not enabled; cross-subgraph type reference with wrong namespace prefix.

Common situations: Renaming a custom type without updating command argument types; referencing a type defined in another subgraph that isn't linked via a type prefix; metadata JSON/YAML hand-edited with a typo'd type name; upgrading a connector extension that no longer registers a type.

Related errors


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