How can I reset the cursor when using useInfiniteQuery?

How does routing work in tRPC especially when using merged routers?
where is useQuery [key]?
const query = useQuery({ queryKey: ['todos'], queryFn: getTodos })
...useInfinieQuery with initialData, Refetch only after second change of inputs

Adding tRPC HOC breaks zustand

Next.js + tRPC, multitenancy, access Next.js Router when setting tRPC headers
/pages/[tenantKey]/
path. The tenantKey
describes which tenant we are working with at the moment. I'm messing around with Next.js + tRPC, and I would love to be able to access the Next.js Router (to access the tenantKey
) in a generic way when accessing the tRPC client. Using the tenantKey
in the path, I could automatically send a header, X-Tenant-Key
, that the server side of tRPC could look at when generating the appropriate context.
I'm thinking some React hook or something for this:
```ts
const useTRPC = () => {...getInfiniteData returns undefined
Enable both `useQuery` and a raw `query` from the frontend (for use in async validation)
Nextjs http endpoint (no prisma)
Adding clerk auth object to createServerSideHelpers
auth
to the context
object. This works great for most requests I've made, but I'm having trouble now that I'm trying to use getStaticProps
and createServerSideHelpers
.
I slightly changed the AuthContext
type so that auth
can be undefined
, which would make sense when the page is generated at build. But is there a way to get auth info in there, when the page gets regenerated later as a user visits? Or would I need to make any auth-related stuff part of the client code?
Snippet:...Call retries were exceeded with ssg
create-t3-app
on Node 18.
Has anyone seen errors trying to use SSG with TRPC and Prisma? I'm new to the T3 stack overall so I'm not sure if the error really comes down to Next, Prisma, or TRPC here. But when I try building with the code below, I'll run into Error: Call retries were exceeded
, coming from, of all things, next/dist/compiled/jest-worker/index.js
, which I thought was super weird. Not sure how this could be related to Jest.
There are 1204 cats, so I'm trying to generate 1204 pages here, so maybe that's just too much? I noticed that if I add take: 10
to getStaticPaths
, then I don't see this error anymore. But on the other hand, all I'm trying to do to generate each one is just a simple db query. TBH I would have this expected to scale to as many pages as I need to generate here....How does batching work in SSR & nextjs app directory?
"This is likely not portable" error

Integrate third-party added endpoints into the router definition?
Why am I seeing 500 errors on responses to clients in production?
[{"error":{"message":"connect ECONNREFUSED 127.0.0.1:5432","code":-32603,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500,"path":"budget"}}}]
I would expected the message to not show up, and just give a generic error message.
Why don't these errors get written to stdout
by default instead? Or maybe I don't have it setup correctly?...trpc auto refreshes page when I lose focus
Incorrect type errors

query debounce
useQuery
in react. I'm basically firing an api call everytime the user change his input which start to be quite a lot when he keep the "delete" key pressed on the keyboard....