Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

Easier way to group query results?

I need to group the total number of pull requests merged by day on a specific period of time, is there a way to achieve that directly via an API query call ? I`m new to GraphQL, and currently i`m using an approach where i`ll have to do that in my side.

My current code:

query {
  repository(owner: "microsoft", name: "vscode") {
    detailedInfo: pullRequests(orderBy: {field:CREATED_AT, direction:DESC}, first: 100) {
      edges {
        node {
          id
          state
          updatedAt
          mergedAt
          closedAt
          createdAt
        }
      }
    }
  }
}
1 Reply
Community Manager
Message 2 of 2

Re: Easier way to group query results?

No, GraphQL doesn't provide a way to perform aggregation within the query language itself. The aggregation has to be performed server side and provided as a new data type or field on an existing data type or it has to be done client side.

 

I hope that helps!