Async User Call in `createContext` (context.ts) or in `isAuthed` (in trpc.ts)
Hi all! Should I be getting the user in all requests via createContext in the following async call
Or would it be more sensible for this to only be called in certain procedures such as middleware like isAuthed? In theory, I don't want public API calls being slower because of the delay it takes to fetch the user.
(we use NextJS if relevant)
S
santi•407d ago
How does this look?
N
Nick•406d ago
Whichever works for you
They’re both fine
4.8KMembers
View on DiscordMore Posts
'req' of undefined in onError of express middlewareI've recently noticed that I get a bunch of errors regarding req object missing in ctx for onError pMutations and Queries in React Contexts causing unexpected behaviorsIn my organization, we recently moved to put all of our mutations/queries into React Contexts and ouCustom error managementHey peeps! I could've sworn I created a GitHub issue about this, but I must've been dreaming, becauscontext questionWhy are the context examples only showing opinionated examples with next/react auth ? Also i find itasync middlewareis it possible to define an async middleware?
I want to do something like this but it throws errors The type of the second route of the nested route is neverhttps://github.com/StringKe/nx-mulit-trpc-type-error/blob/main/apps/app1/src/pages/index.tsx#L12errorFormatter ignored when using appRouter.createCallerMy errorFormatter works correctly in the actual application using an adapter, e.g.
``` trpcExpress.Is there a way to define the Websocket protocol when using wsLink()I am attempting to use tRPC with Azure's Pub/Sub Websockets service it appears to require custom pro