webiny-js
webiny-js copied to clipboard
🍡 GraphQL Request Batching
Out of the box, Webiny configures its GraphQL client (Apollo Client) with a BatchHttpLink, meaning, it will batch GraphQL queries that are happening at the same time, and instead of sending multiple parallel HTTP request, it will combine all payloads into one HTTP request. On the GraphQL API side, Webiny unpacks the payload, processes each query individually, and then returns the response as one big payload. The GraphQL client then unpacks the response and distributes data to its requesters.
This works well for the majority of projects. However, there are scenarios when you don’t want batching to happen at all, or want to control how many requests are batched, how they’re grouped, etc.
With this feature we allow you to configure batching in our GraphQL client as you wish.
For more details, please refer to this tutorial: https://www.webiny.com/docs/admin-area/extending/graphql-request-batching