type safety with meta

how do I get the meta types to work correctly?
No description
No description
B
Bean20d ago
I want the authRequired type to automatically infer the correct type for the context in my protectedProcedure, I have the isAuthed middleware set up to throw an error if the meta is set to true, but that type doesnt work in my procedure and the usermodel type is still nullable how can I fix that?
AK
Alex / KATT 🐱20d ago
Just don't use meta here
B
Bean20d ago
how do I set this up then?
AK
Alex / KATT 🐱20d ago
Use protected procedures for protected ones and public for non protected ones
More Posts
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.To show an examples of the many variants an implementations here is an example: In TRPC Docs: httpTypeError: cache is not a functionTrying to run vitest integration testing on a procedure but i keep running into errors with a "cacheCan't throw errorMy request is pending although throw new TRPCError() executed. Something wrong here?How to use `getQueryKey` from the server side?Hi guys, i cannot figure out how to use `getQueryKey` from the server side. Is this possible? The ukeep previous dataTrpc 11 (trpc@next) doesn’t have support for keepPreviousData? I’m trying to useQuery with keepPreviContext with trpc ws clientHello! I've implemented trpc to my nextjs 14 app router project, along with trpc socket subscriptionCannot use usemutation in my nextjs/t3 projectI have this code ` const mutation = api.auth.addaccount.useMutation(); const handleLogin = async Has anyone passed supabase user to the tRPC context in Expo?I am trying to pass the logged in user to the context of tRPC. To be able to use it in the routers aCould we PLEASE get more docs on subscriptions / observables?They sem to me extremely useful and important and there is just about no documentation on them at alAdding trpc.useQuery hook to Next.js page with react-hook-form prevents stateful refresh.Hi, I'm new to tRPC so apologies if I've worded this poorly. I've got a page with a form managed by React-query options not available in trpc/react-query?I'm not sure if I'm misunderstanding something, but i'm trying to use the `keepPreviousData` option Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11 ] [ NextJS v14.1.X ]Good Morning I am getting the above error when updating to the latest version of NextJS - 14.1.1 thrCan I create custom terminating links?There are cases where a user of my application is offline and can't have access to the server. I'd lI want to use tRPC but I don't want a serverCan I have tRPC exclusively run on the client? I don't want to have any servers. The architecture a