Oh yeah, I got confused with the word updates, but I do pass multiple mutations in a single call.
To illustrate what I meant about the payments, let me give you an explanation:
-
I have a table of invoices, they have five columns: Amount, Paid amount, To_Pay amount, Payment_ID and ‘Is_Paid’ (boolean that checks true if To_Pay amount equals 0).
-
I have a table of payments with two columns: Payment_ID, Payment_Amount.
The idea is that whenever I make a payment, the n invoices that got paid with it update their amounts, this in FIFO order.
By example, a simplified version of my invoice table looks like this:
‘cheeseburger invoice. Amount: $10, To pay: $10, Paid: $0, Payment_ID: (empty)’
‘cinema invoice: Amount: $15, To pay: $15, Paid: $0, Payment_ID: (empty)’
‘phone bill invoice: Amount: $30, To pay: $30, Paid: $0, Payment_ID: (empty)’
let’s say I submit a $25 payment (ID: #1). It’s going to update the invoice table to this:
‘cheeseburger invoice. Amount: $10, To pay: $0, Paid: $10, Payment_ID: #1’
‘cinema invoice: Amount: $15, To pay: $0, Paid: $15, Payment_ID: #1’
‘phone bill invoice: Amount: $30, To pay: $30, Paid: $0, Payment_ID: (empty)’
Now, I made a $30 payment (ID #2). It’s now going to look like this:
‘cheeseburger invoice. Amount: $10, To pay: $0, Paid: $10, Payment_ID: #1’
‘cinema invoice: Amount: $15, To pay: $0, Paid: $15, Payment_ID: #1’
‘phone bill invoice: Amount: $30, To pay: $0, Paid: $30, Payment_ID: #2’
They were two payments so I had to press my button twice. What is happening right now is that, if I do not refresh the website, the second time I press the button and the action does the API call to update my invoices, the values are not getting updated, so it looks like my phone bill was never paid.
Of course, I could just say I made a $50 payment, but that’s not the idea since in real life I made two different payments.
I hope I’m being understood, English is not my first language and I can’t give too much details about the app.