ampp
ampp10mo ago

Running same query multiple times in a mutation

Is there any downside to running the same query more than once in a mutation?
3 Replies
ballingt
ballingt10mo ago
The same ctx.db.query() call? That's fine
ampp
amppOP10mo ago
Yeah, our app is just so db heavy that I want to do whatever possible to save resources. Is there any best practice resource for this as ultimately we are optimizing for several factors. function calls, actions, bandwidth etc
jamwt
jamwt10mo ago
If you fetch the same documents, it’s already cached. You won’t incur additional db bandwidth or fetch latency for those records.

Did you find this page helpful?