Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic load relations #24149

Open
simplo-marcind opened this issue May 10, 2024 · 0 comments
Open

Dynamic load relations #24149

simplo-marcind opened this issue May 10, 2024 · 0 comments
Labels
kind/feature A request for a new feature. team/client Issue for team Client. topic: relations

Comments

@simplo-marcind
Copy link

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

@Druue Druue added kind/feature A request for a new feature. topic: relations team/client Issue for team Client. labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. team/client Issue for team Client. topic: relations
Projects
None yet
Development

No branches or pull requests

2 participants