title: HotChocolate distinct values from filtered result set
body: <p>I have a sql table looking like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Product</th>
  <th>User</th>
  <th>Status</th>
  <th>CreatedDate</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>Cheese</td>
  <td>John</td>
  <td>New</td>
  <td>2022-02-07</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Milk</td>
  <td>Steve</td>
  <td>Pending</td>
  <td>2022-06-12</td>
  </tr>
  <tr>
  <td>3</td>
  <td>Juice</td>
  <td>Steve</td>
  <td>New</td>
  <td>2022-06-10</td>
  </tr>
  <tr>
  <td>4</td>
  <td>Beer</td>
  <td>Lloyd</td>
  <td>Finished</td>
  <td>2021-12-01</td>
  </tr>
  <tr>
  <td>5</td>
  <td>Apples</td>
  <td>Luis</td>
  <td>Finished</td>
  <td>2022-05-10</td>
  </tr>
  <tr>
  <td>6</td>
  <td>Oranges</td>
  <td>John</td>
  <td>Pending</td>
  <td>2022-05-10</td>
  </tr>
  <tr>
  <td>7</td>
  <td>Carrots</td>
  <td>John</td>
  <td>New</td>
  <td>2022-06-23</td>
  </tr>
  <tr>
  <td>8</td>
  <td>Cookies</td>
  <td>Fred</td>
  <td>Canceled</td>
  <td>2021-11-07</td>
  </tr>
  <tr>
  <td>9</td>
  <td>Jelly</td>
  <td>Luis</td>
  <td>Pending</td>
  <td>2021-05-30</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>On web page, I am showing this table in pages, by 3 item:</p>
  <p>Page 1:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Product</th>
  <th>User</th>
  <th>Status</th>
  <th>CreatedDate</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>Cheese</td>
  <td>John</td>
  <td>New</td>
  <td>2022-02-07</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Milk</td>
  <td>Steve</td>
  <td>Pending</td>
  <td>2022-06-12</td>
  </tr>
  <tr>
  <td>3</td>
  <td>Juice</td>
  <td>Steve</td>
  <td>New</td>
  <td>2022-06-10</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Page 2:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Product</th>
  <th>User</th>
  <th>Status</th>
  <th>CreatedDate</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>4</td>
  <td>Beer</td>
  <td>Lloyd</td>
  <td>Finished</td>
  <td>2021-12-01</td>
  </tr>
  <tr>
  <td>5</td>
  <td>Apples</td>
  <td>Luis</td>
  <td>Finished</td>
  <td>2022-05-10</td>
  </tr>
  <tr>
  <td>6</td>
  <td>Oranges</td>
  <td>John</td>
  <td>Pending</td>
  <td>2022-05-10</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>etc.</p>
  <p>Now, using odata query, I can filter this table using such query:</p>
  <pre><code>/odata/products?$filter=Status eq 'New'
  </code></pre>
  <p>or</p>
  <pre><code>/odata/products?$filter=CreatedDate eq '2022-05-10'
  </code></pre>
  <p>I am creating such filters dynamically.</p>
  <p>Now, for filtered or unfiltered results I would like to retrieve distinct list of, for example, Users or Statuses:</p>
  <ul>
  <li>to get distinct list of Users for status 'New' I am sending for example this odata query: <code>/odata/products?$apply=filter(Status eq 'New')/groupby((User))</code></li>
  <li>to get distinct list of Statuses for selected User I am sending for example this odata query: <code>/odata/products?$apply=filter(User eq 'Steve')/groupby((Status))</code></li>
  </ul>
  <p>How can I achieve something similar using graphql, especially with HotChocolate?</p>
  <p>Receiving filtered results are simple - just create a query with filtering and paging.
  But what about retrieving distinct values from filtered dataset? Such a query must not use paging - we should get distinct values from all pages, not just from page 2 for instance.</p>