apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
813 stars 271 forks source link

Add configurable limit for query batching #6134

Open lennyburdette opened 1 month ago

lennyburdette commented 1 month ago

Describe the solution you'd like

Support a limit on the number of requests in a batch, effectively enforcing the client-side setting. For example:

batching:
  enabled: true
  mode: batch_http_link
  max_requests: 10

Describe alternatives you've considered

AFAIK it's not possible to use Rhai/coprocessors to enforce this because the parsed batch body is not available within extensions points.

Additional context

Raised on behalf of a customer