T
tRPC

trpc subscription with react-query

trpc subscription with react-query

Kkamama9/29/2023
TRPCClientError: Subscriptions should use wsLink having error when use subscription with react-query import { createTRPCReact } from "@trpc/react-query"; export const trpc = createTRPCReact<AppRouter>(); const wsClient = createWSClient({ url: ws://localhost:8080/ws, }); const trpcClient = trpc.createClient({ transformer: SuperJSON, links: [ httpLink({ url: /trpc, }), wsLink({ client: wsClient, }), ], }); <trpc.Provider client={trpcClient} queryClient={queryClient}> <QueryClientProvider client={queryClient}> </QueryClientProvider> </trpc.Provider>
AAlwayzPatrick10/6/2023

Looking for more? Join the community!

T
tRPC

trpc subscription with react-query

Join Server