The possibility of changing the `ctx` to add more data onto it
so, I'm exploring the possibility of passing the
ctx.auth.userId
and ctx.cache
to use in multiple queries in my code. just out of pure curiosity, can I wrap the ctx
to serve these data?
Also, say if I have a value that I need to fetch only once, and want it to be there across files/folders in my backend, can I export it once and call it from multiple files?2 Replies
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!
Customizing serverless functions without middleware
Re-use code and centralize request handler definitions with discoverability and type safety and without the indirection of middleware or nesting of wr...