facebook / facebook/relay

How do you handle multiple useMutation commit calls?

Open
#3,549 2 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

I am looping over objects and I need to call the same mutation on all these objects, once all the calls are done, I need to check for an error and display an error modal.

Issue: `[commit] = useMutation()` does not return a promise, so I can't do `Promise.all(allUpdates)`

What is the proper way of waiting for all mutations to be completed or can I combine all update request into 1 commit?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.