You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm always frustrated when I have to load relations for an object. Currently prisma requires to define which relation should be included when we fetch the data from database. const user = await prisma.user.findFirst({ include: { posts: true } })
Suggested solution
const user = await prisma.user.findFirst() console.log(user.posts)
Hi
Problem
I'm always frustrated when I have to load relations for an object. Currently prisma requires to define which relation should be included when we fetch the data from database.
const user = await prisma.user.findFirst({ include: { posts: true } })
Suggested solution
const user = await prisma.user.findFirst()
console.log(user.posts)
Alternatives
Currently I use Eloquent ORM in PHP and it's i VERY helpful
https://laravel.com/docs/master/eloquent-relationships#one-to-many-inverse
Can we implement this feature in prisma?
Have a nice day
Marcin
The text was updated successfully, but these errors were encountered: