Light
Dark
System
v4latest
v4latest
v3
v2
v1

Declaring aliases

Define an alias that merges some information from links as computed properties, this is a way of flattening a nested structure:

Copy
alias ReviewAlias := Review {
    # It will already have all the Review
    # properties and links.
    author_name := .author.name,
    movie_title := .movie.title,
}

Define an alias for traversing a backlink, this is especially useful for GraphQL access:

Copy
alias MovieAlias := Movie {
    # A computed link for accessing all the
    # reviews for this movie.
    reviews := .<movie[is Review]
}

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.

Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.