How to call public query from action?
This seems like it should be super obvious, but I can't see to understand how to reference the public query within the runQuery method.
6 Replies
hm, what syntax are you trying to use? ctx.runQuery(api.file.myQuery) should do it
Is that still valid if the action and query are in the same file?
Yep
Okay I’ll try that. Thank you!
I noticed in the docs that internal queries are used in the examples, no security concerns with importing queries and calling them from an action like this?
@Cam (maybe this could be another support thread?) it doesn't look like you're using internal queries in that example. Public queries are available for anyone to call. If the queries don't check auth and expose secure information, then that would be a security concern