graphql-codegen-hasura icon indicating copy to clipboard operation
graphql-codegen-hasura copied to clipboard

How to make aggregate query

Open sondh0127 opened this issue 5 years ago • 0 comments

Does the plugin generate the "aggregate" query

I have a query to fetch the "project" list with the pagination(offset and limit) and also want to get the total number of the list by (projects_aggregate)

query ExploreProjects(
  $name: String
  $offset: Int
  $limit: Int
) {
  projects_aggregate(
    where: {
      ...
    }
  ) {
    aggregate {
      count
    }
  }
  projects(
    limit: $limit
    offset: $offset
    order_by: { updated_at: desc }
    where: {
      ...
    }
  ) {
    ...Project
  }
}

sondh0127 avatar Jul 15 '20 18:07 sondh0127