Emmytobs
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
Though, that example uses Next.js' pages router, so I had to change the code in the
/trpc/[trpc]
api route to look like the screenshot in my earlier message - that only seemed to work with Next.js app router.16 replies
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
Oh yeah, I have a separate server for websockets set up. I basically followed the same setup in the example here: https://github.com/trpc/examples-next-prisma-websockets-starter/blob/daf54ca6576f3e290aa4f36dc7d0ff1eb718b716/src/server/wssDevServer.ts.
16 replies
How to get data type from onMutate function in useMutation
Since you shared the type inference on tRPC's website and I couldn't replicate it without the annoying TS error, I just thought I'd point it out to let you know. My guess is it's likely something that has to do with my TS version (which was why I shared my list of dependencies)
30 replies
How to get data type from onMutate function in useMutation
That's definitely a way to avoid the error. The only reason I wanted the put the mutation function in a separate file is just for better organization - the router file could get really long if I have lots of procedures.
30 replies