is there a way to run an action like it were a query?
I want to fetch data from an authenticated, external API endpoint. I can only fetch inside an action, but it seems like
useAction only returns a function that I can call and get back a promise (as if it were a mutation). Is there any tooling to allow me to use an action as if it were a query?
I've searched discord and asked AI and seems like maybe the best bet is do wire it up to tanstack query or similar to do the execution of the action inside my component, whatever deduping and client caching I want to do, etc.
I would have expected Convex to provide more tooling around this given the limits of "no fetching in queries". And mirroring all the external API data into my Convex DB doesn't seem like a great solution either.1 Reply
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 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!