so basically I want something like this: ``` quer...
# random
s
so basically I want something like this:
Copy code
query {
  posts (where: {...}) {
    content
    comments {
      count // <- how to do this efficiently?
    }
  }
}
r
I think you need to make a new type and resolver for
comments
. Something like this:
Copy code
type Comments {
  comments: [Comment!]!
  count: Int!
}
and then create the resolver with an aggregate like in the node tutorial: https://github.com/howtographql/graphql-js/blob/master/src/resolvers/Query.js
j
But I thought Prisma already has its generated aggregation functions so you don’t need to do this?