-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Implement supplementary directives for all Eloquent relationship types #332
Comments
@enzonotario have you started work on |
not yet, but I can work on that this weekend! |
I would like to get the Roles of my UserModel, im using spatie/laravel-permissions. Any clue ? When @morphedByMany implementation ? |
Could you try You can currently fetch the data also without directive, but you will not have performance benefits from data loaders, as every field will be resolved separately, means every time laravel goes to DB. |
Sounds like a workaround, would be amazing to get this fixed / implemented :-) |
Is your feature request related to a problem? Please describe.
Many users have come up with use cases where they require some of the other relationship types of Eloquent, such as Polymorphic relationships or Pivot Relations. In many cases, they work fine without any directives or do also work when using
@belongsTo
or@hasMany
, although edge cases do come up from time to time.To clarify: Other relationship types still work without those directives. They can simply be declared as fields on the type without using any directives.
Describe the solution you'd like
Implement additional directives for Eloquent's other relationship types. I am sure we can
do some nice optimizations and make Lighthouse even more simple to use.
https://laravel.com/docs/eloquent-relationships#defining-relationships
Support
The text was updated successfully, but these errors were encountered: