A. Perkamentus
A. Perkamentus15mo ago

Can you get the queryClient without using a hook?

Can you get the queryClient without using a hook?
4 Replies
Nick
Nick15mo ago
Yes if you don't need SSR, you create it during setup and it doesn't have to be created inside a component. It's just a variable you can export
A. Perkamentus
A. Perkamentus15mo ago
I forgot to add that I am using it with NextJS, I have a withTRPC wrapper in my App. Is there a way to extract the queryClient from there?
Nick
Nick15mo ago
You will need the hook then RQ has useQueryClient I believe If you’re not using SSR you can probably get away with replacing the withTRPC with something lower level, but if you want SSR then it’s the hook for the above reasons
More Posts
How can I reset the cursor when using useInfiniteQuery?I have various filters that I can set for the query, but when setting those filters I need to reset How does routing work in tRPC especially when using merged routers?I am having trouble understanding how tRPC lays out routes. Let's say I have the below ```typescripwhere is useQuery [key]?Learning trpc, i use to tanstack with queryKey, can not find how that works with trpc, if i want tuseInfinieQuery with initialData, Refetch only after second change of inputsHi everyone, I have the problem as stated in the title. My code looks like the following: ```ts Adding tRPC HOC breaks zustandIt seems that adding the trpc hoc breaks my zustand stores initial values and generates bad data. AfNext.js + tRPC, multitenancy, access Next.js Router when setting tRPC headersHey all! I'm writing a multi-tenant solution. Most Next.js pages lie under the `/pages/[tenantKey]/`getInfiniteData returns undefinedI am using the t3-stack. Whenever I am calling getInfiniteData it returns undefined. ``` console.loEnable both `useQuery` and a raw `query` from the frontend (for use in async validation)Hello everyone, some context: ``` . I'm building a project with a variant of the t3 stack (key pointNextjs http endpoint (no prisma)I have simple pages/api/todoEndpint how do i call this endpoint with trcp? I don't want to use prismAdding clerk auth object to createServerSideHelpersSo I followed clerk's docs for TRPC (https://clerk.com/docs/nextjs/trpc) and I added `auth` to the `