How to use trpc react hooks from an external data source

Hi, I have a monorepo, nextjs and keystone cms. The cms has trpc running, and I managed to get it connected to my nextjs. Is it possible for example to use the useQuery hook with that connection? Atm I use
createTRPCProxyClient
createTRPCProxyClient
from "@trpc/react", but it seems to be the same as I would import it from "@trpc/client". See screenshot Thanks for any help! 🙂
UU
Unknown User547d ago
W
.westsaid544d ago
Hi, yes kind of, as the discussion on my other issue states: I have a type error which I cannot fix in a reproductive way. It seems to me that its just a type error as I receive data using the cmsTrpc variable as if there was no error. Although this of course stops me from building...
UU
Unknown User544d ago
W
.westsaid534d ago
Hey, I've uploaded a working nextjs-trpc-keystone example: https://github.com/Westsaid/nextjs-trpc-keystone-example
GitHub
GitHub - Westsaid/nextjs-trpc-keystone-example
Contribute to Westsaid/nextjs-trpc-keystone-example development by creating an account on GitHub.
UU
Unknown User534d ago
M
moloch339d ago
Thanks for this repo, it was super helpful to me. Have you ever tried enabling tRPC's subscription support via websockets? struggling to get that working inside of Keystone.js's config
W
.westsaid339d ago
Hi, glad it was super helpful for you 😊 Unfortunatly no, didnt touch subscriptions yet
More Posts
NextJS & Keystone CMS, issues when connecting both in a monorepoHello everyone, so I have a monorepo with NextJS and keystone cms, both are running trpc v10beta.15Best practices for implementing an offline applicationHey there! I'm building a full stack react-native app with Expo and a tRPC backend. I'd like for thisomehow when move typed function out of the router files, frontend infer type to be any ?this is inferred corrected since they are in the same file. ``` getX: t.procedure.query(() => { retBig companies that use tRPC?Some of my fellow colleagues were wondering if there are any big companies that use tRPC and how matSSG on nextJS when appRouter is made with fastify adapter?```js export const getStaticProps: GetStaticProps = async () => { const ssg = await createSSGHelpeMigrating to V10 from V9If someone has some ideas on what I might have screwed up when trying to bump tRPC for this public sAuthentication broke after bump to v10 from v9Anyone that has any suggestions on what might have caused this? I get the following error when tryiShow a spinner when any mutation is loading?Looking to show an activity spinner in the header of our application whenever a mutation is in flighSharing schemas between server and clientIn a typical nextJs setup, what is the idiomatic way to share zod schemas between frontend and backev10 Migration interop, router doesnt have attributesHi, i've tried to migrate like stated in the docs, these are my routers. Question: Shouldn't appRoutRecommended file structure for next.js?Hey all - using tRPC heavily with next.js and it's great. Our main `[trpc].ts` file is getting huge Unhandled Runtime ErrorTRPCClientErrorCall Stack Function.from node_modules\@trpc\client\dist\TRPCClientError-09b8a26b.esm.js (57:0) transWeird error when running unit test`10.0.0-proxy-beta.5` works just fine, error occurs on `10.0.0-proxy-beta.6` with the introduction oSharing middleware between TRPC serversWe currently have *microservices* REST API's on Cloudflare Workers and I'm thinking about moving thiIs `trpc.withTRPC` for Next supposed to work with pages or only `_app`?I'd love to only have TRPC mount on certain pages of my Next.js app. Is this currently supported?What does the WebSocketHandler do?I'm not sure what this is doing on the background.