HaxH
tRPC3y 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
Was this page helpful?