Need help with dgraph query

Ah I see, yes thats beyond what the tutorial is covering. Sorry I misunderstood your question, it looked trivial. To do what you want, you need some kind of mapping of uids to aggregation.
While it’s easy to gather the informations for such a mapping with eg:

{
  v(func: has(customer_name)) {
    cname: customer_name
    did_order {
      order.item {
        itemuid: uid
      }
    }
  }
}

… I don’t know how to do the mapping with a query and would do that with the result in a program.

Maybe that can be done anyhow with @groupby?