tRPCttRPC
Powered by
HaxH
tRPC•3y ago•
4 replies
Hax

Context being destroyed in mutator

Im currently building an app using the t3 stack + clerk for auth

I have an operation which relies on a user's id being passed in my trpc backend, which on other routers was being passed fine through the context object

Specifically within this router and this mutator method, I am getting the values from context up until my prisma method is called (I think) and then they disappear. The mutator method is getting the context value, as I console.logged it before hitting this specfic api route

Things attempted:

- Merge existing ctx object with new ctx object
- run middleware as async with awaits,
-

Any sort of insight or other things I can try is appreciated
Code snippets in comments
Solution
Solution: pass uid in from frontend using custom hook
Jump to solution
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Next-auth session not being fetched in tRPC context
MinhazMMinhaz / ❓-help
3y ago
Context is not being passed correctly
CodexCCodex / ❓-help
2y ago