webiny-js icon indicating copy to clipboard operation
webiny-js copied to clipboard

🍡 GraphQL Request Batching

Open m0nikaza opened this issue 1 year ago • 1 comments

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.

m0nikaza avatar Oct 20 '23 13:10 m0nikaza

For more details, please refer to this tutorial: https://www.webiny.com/docs/admin-area/extending/graphql-request-batching

m0nikaza avatar Oct 20 '23 13:10 m0nikaza