-
-
Notifications
You must be signed in to change notification settings - Fork 598
Description
I'm submitting a ...
- bug report
- feature request
- question
Some other GraphQL server implementations support a batch query protocol, whereby multiple GraphQL requests can be assembled into an array, the array is sent to the server, each of the requests is separately executed on the server, and their results are returned in one array to the client.
Example usage can be found here for Apollo: https://blog.graph.cool/improving-performance-with-apollo-query-batching-66455ea9d8bc
And an example implementation in Apollo server can be found here: https://github.com/apollographql/apollo-server/blob/3fecfcd3218c2f7f2c5ed59a351d71022944bc35/packages/apollo-server-core/src/runHttpQuery.ts#L65
This feature request proposes that PostGraphQL support a similar scheme, in order to allow clients to optionally make GraphQL requests to the PostGraphQL server in a batch mode, enabling multiple operations to be performed with a single HTTP request.
An example use case would be a client that needs to perform ten separate mutations (say, updating ten separate DB objects with new data). With batching, instead of sending ten separate HTTP requests to the PostGraphQL server, the client could send one larger HTTP request that contains an array of those ten mutations, and receive and array of ten results.