hasura/graphql-engine · error · GraphqlConfigError

the fieldName for limitInput needs to be defined in GraphqlC

Error message

the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API

What it means

Raised when at least one model in the supergraph exposes a `selectMany` GraphQL API, but the single GraphqlConfig does not define the `limitInput` fieldName. The selectMany API needs an input argument name for pagination limits, which must be declared up front. Thrown during the graphql_config metadata resolution stage.

Source

Thrown at v3/crates/metadata-resolve/src/stages/graphql_config/error.rs:11

use graphql_types as ast;

use crate::types::error::ContextualError;

#[derive(Debug, thiserror::Error)]
pub enum GraphqlConfigError {
    #[error("graphql configuration is not defined in supergraph")]
    MissingGraphqlConfig,
    #[error("graphql configuration should be defined only once in supergraph")]
    MultipleGraphqlConfigDefinition,
    #[error(
        "the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API"
    )]
    MissingLimitFieldInGraphqlConfig,
    #[error(
        "the fieldName for offsetInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API"
    )]
    MissingOffsetFieldInGraphqlConfig,
    #[error(
        "the filterInput needs to be defined in GraphqlConfig, when models have filterExpressionType"
    )]
    MissingFilterInputFieldInGraphqlConfig,
    #[error(
        "the orderByInput needs to be defined in GraphqlConfig, when models have orderByExpressionType"
    )]
    MissingOrderByInputFieldInGraphqlConfig,
    #[error(
        "the orderByInput.enumTypeNames needs to be defined in GraphqlConfig, when models have orderByExpressionType"
    )]

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add `limitInput: {fieldName: "limit"}` (or your preferred name) to the GraphqlConfig
  2. If you do not want limit pagination, remove the selectMany API from the model or accept it is required and define the field
  3. Regenerate metadata with a current CLI/template that emits limitInput automatically

Example fix

// before
{"graphql": {"offsetInput": {"fieldName": "offset"}}}
// after
{"graphql": {"limitInput": {"fieldName": "limit"}, "offsetInput": {"fieldName": "offset"}}}
Defensive patterns

Strategy: validation

Validate before calling

let needs_limit = models.iter().any(|m| m.has_select_many());
if needs_limit {
    assert!(config.limit_input.as_ref().is_some_and(|l| l.field_name.is_some()));
}

Type guard

fn limit_ok(config: &GraphqlConfig, needs: bool) -> bool {
    !needs || config.limit_input.as_ref().is_some_and(|l| l.field_name.is_some())
}

Try / catch

Err(GraphqlConfigError::MissingLimitFieldInGraphqlConfig) => { /* add limitInput.fieldName and re-resolve */ }

Prevention

When it happens

Trigger: Metadata has a model with a selectMany GraphQL API while the GraphqlConfig lacks a `limitInput` entry (or its `fieldName`). Resolving/validating this metadata triggers the error.

Common situations: Enabling list/selectMany APIs on a model in metadata that was originally authored only for selectOne; migrating metadata that predates the limitInput requirement; partial hand-written GraphqlConfig that only sets offsetInput.

Related errors


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