tRPC prisma query type checking.
I'm wondering what the best practice is for type checking a prisma query in a tRPC function. I've been using input validation with zod for passing parameters into the functions but am not sure how to check types for a query which i then want to perform logic onto.
bookingsPerDate: protectedProcedure.query(async ({ ctx }) => {
const bookings = await ctx.prisma.bookings.findMany({});
for (let i = 0; i < bookings.length; i++) {
checkIn = bookings[i].checkIn;
checkOut = bookings[i].checkOut;
/* More Logic */
}
console.log(bookings);
}),