Declaring aliases
Define an alias that merges some information from links as computed properties, this is a way of flattening a nested structure:
1. alias ReviewAlias := Review {
2. # It will already have all the Review
3. # properties and links.
4. author_name := .author.name,
5. movie_title := .movie.title,
6. }
Define an alias for traversing a backlink, this is especially useful for GraphQL access:
1. alias MovieAlias := Movie {
2. # A computed link for accessing all the
3. # reviews for this movie.
4. reviews := .<movie[is Review]
5. }
Aliases allow to use the full power of EdgeQL (expressions, aggregate functions, backlink navigation) from GraphQL.
The aliases defined above allow you to query MovieAlias with GraphQL.
︙
| See also |
| Schema > Aliases |
| SDL > Aliases |
| DDL > Aliases |
