Emmytobs
Emmytobs
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
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
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
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
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
No description
16 replies
TtRPC
Created by mwinel on 4/30/2024 in #❓-help
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
If that's the case, then it seems you can only use tRPC subscriptions in Next.js projects that use the pages router.
16 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
Thanks for explaining!
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
Oh, that makes sense. Just one of the interesting behaviors of TS, i guess.
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
I'll keep the procedures in the router file - and would try to keep an eye out for a solution.
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
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
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
Gotcha. There's definitely a good reason behind starting out simple and refactoring as the project gets bigger.
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
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
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
Thanks so much for responding.
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
No description
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
No description
30 replies
TtRPC
Created by G$Row on 5/3/2024 in #❓-help
How to get data type from onMutate function in useMutation
No description
30 replies