{"record":{"id":"3de84be72fc46c4d","repo":"hasura/graphql-engine","slug":"the-fieldname-for-limitinput-needs-to-be-defined-i","errorCode":null,"errorMessage":"the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API","messagePattern":"the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API","errorType":"validation","errorClass":"GraphqlConfigError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/graphql_config/error.rs","lineNumber":11,"sourceCode":"use graphql_types as ast;\n\nuse crate::types::error::ContextualError;\n\n#[derive(Debug, thiserror::Error)]\npub enum GraphqlConfigError {\n    #[error(\"graphql configuration is not defined in supergraph\")]\n    MissingGraphqlConfig,\n    #[error(\"graphql configuration should be defined only once in supergraph\")]\n    MultipleGraphqlConfigDefinition,\n    #[error(\n        \"the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API\"\n    )]\n    MissingLimitFieldInGraphqlConfig,\n    #[error(\n        \"the fieldName for offsetInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API\"\n    )]\n    MissingOffsetFieldInGraphqlConfig,\n    #[error(\n        \"the filterInput needs to be defined in GraphqlConfig, when models have filterExpressionType\"\n    )]\n    MissingFilterInputFieldInGraphqlConfig,\n    #[error(\n        \"the orderByInput needs to be defined in GraphqlConfig, when models have orderByExpressionType\"\n    )]\n    MissingOrderByInputFieldInGraphqlConfig,\n    #[error(\n        \"the orderByInput.enumTypeNames needs to be defined in GraphqlConfig, when models have orderByExpressionType\"\n    )]","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/graphql_config/error.rs#L1-L29","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add `limitInput: {fieldName: \"limit\"}` (or your preferred name) to the GraphqlConfig","If you do not want limit pagination, remove the selectMany API from the model or accept it is required and define the field","Regenerate metadata with a current CLI/template that emits limitInput automatically"],"exampleFix":"// before\n{\"graphql\": {\"offsetInput\": {\"fieldName\": \"offset\"}}}\n// after\n{\"graphql\": {\"limitInput\": {\"fieldName\": \"limit\"}, \"offsetInput\": {\"fieldName\": \"offset\"}}}","handlingStrategy":"validation","validationCode":"let needs_limit = models.iter().any(|m| m.has_select_many());\nif needs_limit {\n    assert!(config.limit_input.as_ref().is_some_and(|l| l.field_name.is_some()));\n}","typeGuard":"fn limit_ok(config: &GraphqlConfig, needs: bool) -> bool {\n    !needs || config.limit_input.as_ref().is_some_and(|l| l.field_name.is_some())\n}","tryCatchPattern":"Err(GraphqlConfigError::MissingLimitFieldInGraphqlConfig) => { /* add limitInput.fieldName and re-resolve */ }","preventionTips":["When enabling selectMany, always add both limitInput and offsetInput","Use a metadata template with pagination fields pre-filled","Validate metadata in CI"],"tags":["graphql","metadata","pagination","limit","select-many"],"backgroundTag":"missing-graphql-config-field","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}