-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
What do you think about extending the eager expression language to support aliases:
const people = await Person
.query()
.eager(`[
children as kids,
parent as p .[
pets(filterDogs) as dogs,
pets(filterCats) as cats
]
]`);
console.log(people[0].p.dogs);Combined with the new Model property namedFilters this would provide a pretty powerful and highly configurable graphql-like language. Competing with graphql is in no way a goal here, but this would be pretty easy to implement without complicating the codebase and could be really useful.
This was originally suggested by @allxie.
What do you think?
biggytech