Stefan Atanasov
PPrisma
•Created by Stefan Atanasov on 8/15/2024 in #help-and-questions
Return type from Prisma query
Hey Prisma ppl. I cannot find what is the Typescript type of a variable that returns
findMany()
For example, what in this case the variable source
type would be?
const sources = await prisma.source.findMany()
Because, if I pass the variable source
to other components, how to set the expected prop type to those components? currently, I'm doing something like this:
sources: Awaited<ReturnType<typeof prisma.source.findMany>>
But there gotta be a better way.4 replies