I just wrote about that ques­tion over on CSS-Tricks. I go into some de­tail there, but the ar­gu­ment boils down to this: Even though a ba­sic idea of the Jamstack is that you do as much of your logic as you can dur­ing your build process (earlier in the pro­gramme life­cy­cle, if you will), you still have op­tions. Namely:

Recently (like on the Wish you were here site), I tend to do a com­bi­na­tion of all of the above.

Again, you can read the full piece on CSS-Tricks.