Why is there no .query() in my trpc procedure

How is this possible? It says
Property 'query' does not exist on type 'DecorateProcedure<{ ctx: { headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; }; meta: object; errorShape: { ...; }; transformer: true; }, MutationProcedure<...>>'.ts(2339)
Property 'query' does not exist on type 'DecorateProcedure<{ ctx: { headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; }; meta: object; errorShape: { ...; }; transformer: true; }, MutationProcedure<...>>'.ts(2339)
No description
No description
5 Replies
cje
cje3mo ago
because you made it a mutation?
saloodpeepo
saloodpeepoOP3mo ago
my bad
saloodpeepo
saloodpeepoOP3mo ago
No description
saloodpeepo
saloodpeepoOP3mo ago
but it doesn't exist even on this is there some setup for it?
getAllProducts: publicProcedure.query(async ({ ctx }) => {
const products = await ctx.db.product.findMany();
return products;
}),
getAllProducts: publicProcedure.query(async ({ ctx }) => {
const products = await ctx.db.product.findMany();
return products;
}),
Neto
Neto3mo ago
Aren’t you pulling server side trpc into client side code? ~/trpc/server
Want results from more Discord servers?
Add your server