You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional thoughts:
I am not quite sure if graphql-mesh or graphql-tools is a better place for this issue. I could easily move it if needed it.
Regarding a potential solution. I could not come up with a very simple one. The only thing that comes to me is to somehow fake mutations execution as a query execution, but this is more a workaround than a solution and could have other side effects I am not aware of.
The text was updated successfully, but these errors were encountered:
Describe the bug
We cannot batch mutations between the mesh and a GraphQL Handler.
To Reproduce
Here is an example repository with example code and steps to reproduce - https://github.com/angelsvirkov/graphql-mesh-batch-mutations.
yarn start-mesh
req.body
. There are 4 requests instead of 1.Expected behavior
The apollo gql server, which is a handler of the GQL Mesh, receives 1 request with all mutations inside of it.
Environment:
@graphql-mesh/cli
: latest@graphql-mesh/graphql
: latestReason why it does not work
The default
graphql-js
execute function callsexecuteFieldsSerially
which breaks down the concept behind the batch-executor ofgraphql-tools
https://github.com/graphql/graphql-js/blob/main/src/execution/execute.ts#L379
https://www.graphql-tools.com/docs/batch-execution#batch-the-executor
Additional thoughts:
I am not quite sure if graphql-mesh or graphql-tools is a better place for this issue. I could easily move it if needed it.
Regarding a potential solution. I could not come up with a very simple one. The only thing that comes to me is to somehow fake mutations execution as a query execution, but this is more a workaround than a solution and could have other side effects I am not aware of.
The text was updated successfully, but these errors were encountered: