Skip to main content

Validation pagination limits

Enforce page-size and pagination-window bounds during GraphQL validation, including argument values supplied through variables.

Practices implemented

Applies to

  • GraphQL servers
  • Gateways and proxies

Configuration (suggested defaults)

ParameterDefaultNotes
defaultPageSize20Used when limit arg is omitted.
maxPageSize100Reject over-limit per-field requests.
maxPaginationWindow1000Reject oversized windows.
enforcementrejectReturn stable validation errors.

Implementation notes

  • Evaluate argument values after variable coercion.
  • Apply rule consistently to all list-returning fields.
  • Include machine-readable error metadata for tooling.

Cautions

  • Requires schema conventions for identifying pagination args.
  • Custom directives may need explicit rule integration.

Problems addressed