hasura/graphql-engine · error

required argument {argument_name} not found on field {field_

Error message

required argument {argument_name} not found on field {field_name} of type {type_name}

What it means

Validation error stating that a field was selected without supplying an argument the schema marks as required (non-null, no default). The validator checks required arguments during normalization and reports the missing one by name.

Source

Thrown at v3/crates/graphql/lang-graphql/src/validation/error.rs:178

        type_name: ast::TypeName,
        field_name: ast::Name,
        argument_names: Vec<ast::Name>,
    },
    #[error("argument {argument_name} on field {field_name} of type {type_name} not found")]
    ArgumentNotFound {
        type_name: ast::TypeName,
        field_name: ast::Name,
        argument_name: ast::Name,
    },
    #[error(
        "argument {argument_name} on field {field_name} of type {type_name} is defined more than once"
    )]
    DuplicateArguments {
        type_name: ast::TypeName,
        field_name: ast::Name,
        argument_name: ast::Name,
    },
    #[error(
        "required argument {argument_name} not found on field {field_name} of type {type_name}"
    )]
    RequiredArgumentNotFound {
        type_name: ast::TypeName,
        field_name: ast::Name,
        argument_name: ast::Name,
    },
    #[error("no fields are selected")]
    FieldSelectionSetIsEmpty,
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add the required argument with a value of the correct type to the field
  2. If you own the schema, give the argument a default value or make it nullable for backward compatibility
  3. Update/regenerate client code after the schema added the required argument

Example fix

# before
query { nearbyPosts { id } } # radius: Float! required
# after
query { nearbyPosts(radius: 5.0) { id } }
Defensive patterns

Strategy: validation

Validate before calling

// Check required args before sending
let missing: Vec<_> = required_args(field_def).filter(|a| !provided.contains(a)).collect();
if !missing.is_empty() { return Err(format!("missing args: {missing:?}")); }

Try / catch

// Catch Error::RequiredArgumentNotFound { argument_name, .. } and prompt for the missing input

Prevention

When it happens

Trigger: Selecting a field that declares a required (non-null, non-default) argument but omitting it: `query { requiredField }` where requiredField(arg: String!) is defined.

Common situations: Schema evolution adds a new required argument and old clients break, hand-written queries missing inputs, codegen clients out of date.

Related errors


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