Playing around with the new framework cli and love it so far. 🙂
The scenario: A player model, who has a list of matches, each match model has some info like goals, overtime etc. I have a model in the database to keep track of the statistics each player, so the player has a one-to-one relationship with a statistics model, containing totalNumOfGoals, totalOvertimePlayed and so on. Instead of calculating these each time the user asks for them, can i setup a function (I was thinking a hook) to perform the update mutation on the statistics model when a match is added/updated? Or am i thinking about this whole setup in a wrong way? 🙂