Dynamic load relations #24149
Labels
domain/client
Issue in the "Client" domain: Prisma Client, Prisma Studio etc.
kind/feature
A request for a new feature.
topic: relations
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: