I'm currently using the GraphQL HoC to pass a mutation through props. However, I'd like to run a batch of mutations simultaneously, while also having error handling and knowing which mutations failed - with the ability to run the failed ones again. I don't know how many mutations I'll run, it'll depend on the number of IDs i get which will be passed down as an Array in props.
What would be the best way to achieve this?
My initial thought was to somehow use the Map method on the array and run the mutation on each one. I dont know how I'll be able to track which ones failed using this method, I also don't know how to run them in parallel
The mutation will look something like this:
updateUserAccount({userId, reason})
I will need to run anywhere between 5-10 of these in parallel
I will pass the mutation through props using the graphql HoC so I'll have access to the mutation in my component. I'd like to run the failed ones 2 more times.