-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
The simple eager query works well and includes all of the results. But when sometimes modifyEager causes an empty eager array to be returned;
Simple Example works well:
const users = await User.query()
.eager('[roles, log_auth]')[
{
"id": 1,
"email": "[email protected]",
"roles": [
{
"id": 2,
"slug": "member-subscripted",
"name": "Member with a paid subscription",
"group": "MEMBER",
}...
],
"log_auth": [
{
"id": 1,
"created_at": "2017-02-23T23:54:35.000Z",
"user_id": 1
}...
]
}
]Sometimes modifyEager works:
const users = await User.query()
.eager('[roles, log_auth]')
.modifyEager('roles', builder => {
builder.select('roles.slug');
})[
{
"id": 1,
"email": "[email protected]",
"roles": [
{
"slug": "member-subscripted"
}...
],
"log_auth": [
{
"id": 1,
"created_at": "2017-02-23T23:54:35.000Z",
"user_id": 1
}...
]
}
]But other times it doesn't:
const users = await User.query()
.eager('[roles, log_auth]')
.modifyEager('log_auth', builder => {
builder.select('log_auth.created_at');
})[
{
"id": 1,
"email": "[email protected]",
"roles": [
{
"id": 2,
"slug": "member-subscripted",
"name": "Member with a paid subscription",
"group": "MEMBER",
}...
],
"log_auth": []
}
]HaNdTriX