Fouad Raheb
Fouad Raheb
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
Haha good luck
14 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
Seems like the only way to not have an empty websocket connection created is by creating wsLink on run time, but this would create multiple connections for each useSubscription. We just need to have a way to not start a connection if no messages are sent yet and no active useSubscription
(runtime) => {
return (ctx) => {
if (ctx.op.type === "subscription") {
return getWSLink()(runtime)(ctx);
} else {
return getBatchLink()(runtime)(ctx);
}
};
},
(runtime) => {
return (ctx) => {
if (ctx.op.type === "subscription") {
return getWSLink()(runtime)(ctx);
} else {
return getBatchLink()(runtime)(ctx);
}
};
},
14 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
No description
14 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
I'm trying to have this example use 2 separate trpc clients, so that only some queries/mutations/subscriptions use the websocket client and the rest with the default http client https://github.com/trpc/examples-next-prisma-websockets-starter
14 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
It didn't help in my case with websockets
14 replies
TtRPC
Created by Zion on 11/1/2023 in #❓-help
Help with inferring output
You better create a separate prisma findMany for each group type
9 replies
TtRPC
Created by Zion on 11/1/2023 in #❓-help
Help with inferring output
Prisma won't properly infer types with a condition in select input
9 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
14 replies
TtRPC
Created by Fouad Raheb on 10/31/2023 in #❓-help
How to have 2 separate trpc clients for http and websockets?
Can you please share the SOA example link? I couldn't find it on the site and github, sorry
14 replies