David
Explore posts from serversHow to get line number in errors?
Hi, we are currently doing this:
to get a vague idea of what the error was, but this doesn't really help you with telling on which line it occurred. Is there a way to achieve this? Logging the trace is kind of pointless as they don't point you to your own procedure.
8 replies
Best way to get the type of the first argument for .query or .mutation
I am creating an abstraction in which I expect the consumer to pass the whole object that is passed as the first argument of
.query
or .mutation
. But im not sure if there is a helper type to get this type from our instance?10 replies
standaloneMiddleware: Merge ctx/meta/input types
Using standaloneMiddleware, it would be great to merge the types (ctx, input, meta) with what is already there when passing that middleware.
In our case:
this is because we want to be sure user.id exists in the context before allowing the usage of this middleware, but when returning like this:
next({ ctx: { ...ctx, newProp: '' } })
you would still want the context type to be merged with the original so your queries and mutations get the complete context.1 replies
How would batching result in a single database query?
On the
httpBatchStreamLink
docs it says that multiple query calls could result in a single database query. How would that work? Should you expect the passed input to possibly be an array to allow for this?
5 replies
Why do some examples create PrismaClient in context, and others don’t
Is there a specific reason to do this or not to do this? I can imagine with the new Prisma extension feature you could do some handy things like attaching multi tenancy data to each query beforehand
1 replies
Revalidate API route from procedure
Hi, is there a way to revalidate a statically generated page from a trpc procedure?
https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#using-on-demand-revalidation
3 replies