#http actions calling external queries

3 messages · Page 1 of 1 (latest)

terse granite
#

Hi everyone, noob here.
I haven't been able to find if i can call a query inside an action. All the examples call internalQuery, but i need to call an external one which is called also from the client. I tried with await ctx.runQuery(get, { params}) (where get is a function defined in the same file as my action) or call it directly, but i got an error because the context received by the action doesn't have access to bd. How can i do this?
My scenario is i have an httpAction that calls an action (because i need npm) and that action should call some queries and mutations to return some data.
Thanks in advance!

warm tideBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!
red heath
#
import { api } from "./_generated/api";
ctx.runQuery(api.foo.bar, args);