Set Default Fields For Relationship #688
Unanswered
JaredCostall
asked this question in
Q&A
Replies: 1 comment
-
up |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm aware
->allowedFields('user.username')
will allow you to select fields from a relationship in a request.But is there any way to set the fields that are loaded by default for a relationship? I'm aware
->select('id', 'title')
works for the base table's fields.A situation occurs when no fields are passed for
allowedFields
so it loads the entire relationship, including fields that I do not want.I know I could leave these fields out of the User's API Resource, but they are required in some situations, and others not.
Beta Was this translation helpful? Give feedback.
All reactions