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
Eager loading relationships
The Rebing\GraphQL\Support\SelectFields class allows to eager load related Eloquent models. Only the required fields will be queried from the database.
The class can be instantiated by typehinting SelectFields $selectField in your resolve method.
You can also construct the class by typehinting a Closure. The Closure accepts an optional parameter for the depth of the query to analyse.
How do I specify the the required fields?
Only the required fields will be queried from the database.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
From the docs
How do I specify the the required fields?
How does it know which fields to select?
Beta Was this translation helpful? Give feedback.
All reactions