TRPC / Prisma findMany not showing properties in auto completion

Ive been pulling my hair out for the last hour and cannot seem to find whats happening. In my TRPC router, I have the following very simple procedure defined (initially a unique model but seems to be a problem with everything using FindMany):
getAll: protectedProcedure.query(({ ctx }) => { return ctx.prisma.example.findMany(); }), And why I try access it on the front end I dont see the typical type completion showing whats on the model but rather some other stuff (at, concat, copyWithin... see the picture attached): import { api } from "~/utils/api"; const Dashboard: NextPage = () => { const router = useRouter(); const ctx = api.useContext(); const { data } = api.example.getAll.useQuery(); return ( <> <main> <div> <p>Your Dashboard</p> <br /> <ul>{data.}</ul> </div> </main> </> ); }; export default Dashboard; Any other prisma functions (findFirst, findFirstThrow... all have autocompletion on the front end). What am I missing?
No description
2 Replies
Sturlen
Sturlen16mo ago
findMany return a list of items, which is likely why you're seeing autocomplete for list methods on your front end https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#findmany
Prisma
Prisma Client API (Reference)
API reference documentation for Prisma Client.
nickparks
nickparksOP16mo ago
Damn sorry youre absolutely right, my miss not pushing to a mao *map
Want results from more Discord servers?
Add your server