When using useBulkMutation with a large number of elements, it triggers a lots of request (expected).
I was thinking to include a way to be able to batch the requests and got some ideas:
- Depend on a library (i.e. p-limit) and allow to configure the number of requests at once on the
useBulkMutation
- The problem here, is that this library has no dependencies, so this would break that "feature"
- Add p-limit as an optional dependency
- Provide a second param to the
mutate of useBulkMutation to specify a function wrapper for the query call (see POC).
- Provide a way to hook onto the
client.query call to allow for global batching or action-batching
Not really sure if any of these sound OK to you.
When using
useBulkMutationwith a large number of elements, it triggers a lots of request (expected).I was thinking to include a way to be able to batch the requests and got some ideas:
useBulkMutationmutateofuseBulkMutationto specify a function wrapper for thequerycall (see POC).client.querycall to allow for global batching or action-batchingNot really sure if any of these sound OK to you.