-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for query batching #513
Comments
Any news on this? |
No any updates, not sure what is the priority for this feature. Not all implementations of GraphQL server supports multiple queries execution support. And with client batching (via aliases) seems to me like a workaround. |
I've got a dynamic list of items that needs to be inserted to a table and have thought that mapping each item to a mutation would batch them up and send as an array in a single request. Is there some existing solution I'm missing? |
I'm using postgraphile, last week this plugin was released postgraphile-plugin-nested-mutations mentioned in postgraphile#793, it allows nested mutations, I can now create or connect existing foreign key items from a variable array, all in one query :) |
I have a solution to this and believe this is possible using a single OkHttp interceptor. I am unsure of what the requirements are other than:
What I have not yet done but is still possible by adding custom headers to each request:
If the above is all that is needed, I have a working solution and would be willing to submit a PR. If not, what else needs to be handled? |
Any update on this topic / discussion? Kind regards |
So from my original comment, I have that implementation working great however, it needs to create a new thread for each request which is not ideal. I am working on a refactor that now sets a custom |
hi @mandrizzle , Did you have anything implemented, could you post them here ? |
Do we have any updates on this? Wondering if someone needs support to help get this over the line, it's super helpful to be able to query batch and I'm surprised this has been open for so long. Would love to know how to help. |
Hasura is another backend that can leverage multiple mutations in a request to ensure all-or-nothing via a db transaction: https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/multiple-mutations.html. |
Took a stab at an implementation here: #3117 if anyone is interested |
Closed with #3117 |
Ref docs:
http://dev.apollodata.com/core/network.html#query-batching
https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862
The text was updated successfully, but these errors were encountered: