Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
const submitHandler = useCallback(() => {
let count = 0
const runMutation = (product) => {
updateProduct({
variables: {
input: {
descriptionHtml: `${product.descriptionHtml}${descriptionValue}`,
title: `${product.title}${titleValue}`,
id: product.id
}
}
}).then((data) => {
console.log('Update product', count, data);
count++;
if(products[count]) runMutation(products[count])
else {
console.log('Update complete');
setShowToast(true);
}
})
}
runMutation(products[count])
}, [products, descriptionValue, titleValue]);
User | RANK |
---|---|
6 | |
5 | |
3 | |
3 | |
3 |