T
TanStack8mo ago
optimistic-gold

Integration with ConnectRPC

Hello everybody, Does anyone have any idea how to integrate ConnectRPC with Start? They have a Query integration but I don't know if it can be used in the paradigm of 'calling a server function' and then using useSuspenseQuery. They also some documentation on SSR but honestly being quite new to the ecosystem I have a hard time following through. PS: There might be an obvious answer, but I have a hard time digesting all these concepts and trying my best.
Protobuf RPC that works
Connect
Simple, reliable, interoperable: Protobuf RPC that works.
Protobuf RPC that works
Connect
Simple, reliable, interoperable: Protobuf RPC that works.
Protobuf RPC that works
Connect
Simple, reliable, interoperable: Protobuf RPC that works.
1 Reply
metropolitan-bronze
metropolitan-bronze8mo ago
I did not even heard about connect before, but looking at the docs I think the following would work: 1. Setup Start with query 2. In router.tsx, add the following to createTanstackRouter Wrap: () => <TransportProvider transport={finalTransport}>{children}</TransportProvider> 3. Use Connect through Query integration 4. Take create function from SSR nextjs docs you linked. You will fetch data in Route > beforeLoad and put it into context.queryClient.setQueryData(["key to be used on frontend"], data). Not sure where does connect integration sets keys for tanstack query though.
React TanStack Start Start Basic React Query Example | TanStack Sta...
An example showing how to implement Start Basic React Query in React using TanStack Start.

Did you find this page helpful?