EdgeQL Tutorial

Shapes

Subtopics

Sometimes it is not enough to fetch the data as-is, but it is necessary to add something extra to it. This can be done by adding a computed field to the shape. Let's fetch all the accounts and add the username length as well as the length of their watchlist to the results:

Input
Run
Output Objects
Press the 'Run' button to evaluate the input

We can even incorporate a comparison to the average username length in our computed field. There are several ways to do this, so in this example we'll use a detached construct to denote that the Account we're referring to in the subquery is supposed to be treated as the original unmodified set in the database rather than the object we're adding the data to:

Input
Run
Output Objects
Press the 'Run' button to evaluate the input