hasura/graphql-engine · error · Error
{value} is not a valid limit value
Error message
{value} is not a valid limit value What it means
Pagination limit arguments in the IR must fall within the accepted numeric range for the limit field. When the provided limit value fails validation (e.g. exceeds the maximum allowed or is otherwise rejected by the argument parser), this error echoes the offending value. It prevents unbounded or invalid limits from reaching data sources.
Source
Thrown at v3/crates/graphql/ir/src/error.rs:58
#[error("The global ID {encoded_value:} couldn't be decoded due to {decoding_error:}")]
FailureDecodingGlobalId {
encoded_value: String,
decoding_error: String,
},
#[error("Unexpected value: expecting {expected_kind:}, but found: {found:}")]
UnexpectedValue {
expected_kind: &'static str,
found: json::Value,
},
#[error("'{name:}' is not a valid GraphQL name.")]
TypeFieldInvalidGraphQlName { name: String },
#[error("'{alias:} is not a valid alias")]
InvalidAlias { alias: String },
#[error("{value} is not a valid limit value")]
InvalidLimitValue { value: u32 },
#[error("{value} is not a valid offset value")]
InvalidOffsetValue { value: u32 },
#[error("field '{field_name:} not found in entity representation")]
FieldNotFoundInEntityRepresentation { field_name: FieldName },
#[error(
"order_by expects a list of input objects with exactly one key-value pair per input object. Please split the input object with multiple key-value pairs into a list of single key-value pair objects."
)]
OrderByObjectShouldExactlyHaveOneKeyValuePair,
#[error("missing non-nullable argument {argument_name:} for field {field_name:}")]
MissingNonNullableArgument {
argument_name: String,
field_name: String,
},View on GitHub (pinned to 724551b9ae)
Solutions
- Lower the requested limit to the maximum allowed by the field/connection (check the schema's constraint directives)
- If you operate the server, raise the configured max limit or add explicit constraint docs to the schema
- Clamp limit inputs client-side before sending the query
Example fix
# before
query {{ items(limit: 100000) {{ id }} }}
# after
query {{ items(limit: 100) {{ id }} }} Defensive patterns
Strategy: validation
Validate before calling
const MAX_LIMIT = 100; const limit = Math.min(requested, MAX_LIMIT);
Type guard
function isValidLimit(v: number, max = 100): v is number {{
return Number.isInteger(v) && v > 0 && v <= max;
}} Try / catch
try {{
await fetchItems({{ limit }});
}} catch (e: any) {{
if (/not a valid limit value/.test(e.message)) {{
return fetchItems({{ limit: 100 }}); // fallback to max
}}
throw e;
}} Prevention
- Clamp limit inputs to the schema-documented maximum before sending
- Read constraint directives from the schema and encode them in client types
- Cap pagination sizes in UI components
When it happens
Trigger: Passing a limit argument larger than the configured/maximum allowed limit for a connection or field, or a value that the limit parser rejects while building IR from the request.
Common situations: Clients requesting limit: 100000 against a server capped at e.g. 100; configuration changes lowering max limits while clients keep old defaults; UI pagination components sending unbounded limits.
Related errors
- {value} is not a valid offset value
- validation failed: {0}
- Unexpected value: expecting {expected_kind:}, but found: {fo
- '{name:}' is not a valid GraphQL name.
- '{alias:} is not a valid alias
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/23f6fbfede80ec76.
Report an issue: GitHub.