Multiple mutations based on dynamic list - separate mutation for each row in the table
Is it possible to have multiple (dynamic) lists of mutations? I have a list (table) of items. For each element I'd like to be able to click the 'Delete' button separately. So each row would have a different
isLoading state for mutations.
For example, imagine the following GUI:
and when clicking the delete button on element1 and element2:
3 Replies
rival-blackOP•3y ago
Ok I think it's possible to handle this on my own by creating some kind of object like:
and manually deal with it on starting mutation, error and success. I'm not sure if that's correct approach but it's the only one that I am aware of.
This is what I came with:
If you encountered a similar problem and solved it differently please share it here.
rival-blackOP•3y ago
This is how it works:
other-emerald•3y ago
For cases like this, I would put each item inside their own component and put the mutation and loading state in there. That should make the code simpler.