seven
can i send data from client to server in subscriptions
ok i discussed this with gpt and i think i understand, so mutation on wsLink goes via websocket not via rest, i have this setup hovewer and this is compromising my websocket mutations is that correct? links: [
splitLink({
condition: (op) => op.type === 'subscription',
true: wsLink({
client: createWSClient({
url:
ws://localhost:7001
,
}),
transformer: superjson,
}),
false: httpLink({
url: http://localhost:7001
,
fetch(url, options) {
return fetch(url, {
...options,
credentials: 'include',
cache: 'no-store',
});
},
transformer: superjson,
}),
}),
], so i would have to create two separate clients one for websockets and one for rest is that correct?8 replies
can i send data from client to server in subscriptions
can you please elaborate? i don't quite get it you said that wsLink is bidirectional but i cannot post any messages via this link, i need to send messages to my ws route in real time, can you please tell how to achieve it?
8 replies
client server counication with webSockets
if i understand correectly you say that i could configure in my trpc client that if i use certain procedure (i want this ws link to work only on placeOrder mutation procedure) than instead od http link ws link would be used and the connection to my procedure would stau open and the data would be transmitted super fast?
12 replies
Cookie authentication flow
Hi i would like to answer my question, the problem was that i did not pass credentials: include to the fetch options, currenty i use experimental_createTRPCNextAppDirClient with experimental_nextHttpLink, this does not allow to pass options to fetch, would you consider adding this option in future release? thanks
4 replies