calculate total sum at query time doesn’t scale well
I’d rather run a callback after mutations to recalc.
That said you should be aware of race conditions in case of concurrent mutations alongside with tradeoffs when recalculation the total on every mutation.
If you application state is critical and totalsum must be updated from within a transaction I’d wrap the whole mutation logic into one transaction block. I guess this is currently not possible with graph.cool. In this case have a look at postgraphql. It let’s you define custom mutations as database functions.