Mark a Query as no-store?
Hiya folks,
I'm trying to build a quiz app using Convex, and currently I have a 'Try again' button at the end of the page, but I would like it to fetch completely fresh question data from my Convex db instead of the same queried data again.
So my question is if there's any way to designate a query function not to cache?
This is my current query implemented:
3 Replies
You can provide the random value from the client, like randomSeed and use that with math random to control client-side when the shuffling happens
Or you can make it a mutation to run fresh every time.
@Lab when I did this, I ended up using a client-provided seed. that way the client can control if it wants the same result (maybe when the user didn't finish it closed/resumed the app?) or a different one
Thank you both!
I passed a client seed into the query args and the shuffle function from my frontend and it works exactly how I wanted it to 🎉