title: Support of aggregate function in GraphQL
body: <p>I'm am very interested by GraphQL for an analytic solution (think of an webapp displaying graphs). But I cannot find any examples of GraphQL using aggregate function. This is a main aspect of most of the queries done by my frontend.</p>
  
  <p>For my solution, we have 3 typical backend calls.</p>
  
  <ol>
  <li>Search</li>
  <li>Aggregate</li>
  <li>Time Series</li>
  </ol>
  
  <p>Let say we have this type specified in GraphQL</p>
  
  <pre><code>type Person {
    name: String
    age: Int
    create_time: Date
  }
  </code></pre>
  
  <ol>
  <li>Search</li>
  </ol>
  
  <p>This seems to be well handled by GraphQL. No question here.</p>
  
  <p>ex. Search age of Person named Bob
  {
    Person(name: "Bob") {
      age
    }
  }</p>
  
  <ol start="2">
  <li>Aggregate</li>
  </ol>
  
  <p>This is the typical case where I want to display the info in a Pie Chart. So let say I want to count the number of person by age.</p>
  
  <p>Here would be the PostgreSQL query:</p>
  
  <pre><code>SELECT age, count(*) from Ticket group by age;
  </code></pre>
  
  <p>What would be the equivalent in GraphQL?</p>
  
  <ol start="3">
  <li>Time Series
  This is the typical case where I want to display the info in a BarChart with the X axis as time.</li>
  </ol>
  
  <p>ex. Let say I want to count the number of created user per hour.</p>
  
  <p>Here would be the PostgreSQL query:</p>
  
  <pre><code>SELECT date_trunc('hour', create_time) as create_time_bin, count(*) from Person group by create_time_bin order by create_time_bin ASC;
  </code></pre>
  
  <p>What would be the GraphQL equivalent query?</p>