GraphQL - Return the Size of an Array Field?

Hey @MattH,

Unfortunately dgraph only generates the aggregate<Field> queries for lists of Types or Interfaces (https://dgraph.io/docs/v21.03/graphql/queries/aggregate/#advanced-aggregate-queries-at-root).

However you can easily achieve what you need with Lambda resolvers. Have a look at this document: https://dgraph.io/docs/v21.03/graphql/lambda/query/

Let me know if you need help.

1 Like