title: How to update GraphQL query on button click
body: <p>I'm looking for a good way to update the "<strong>orderBy: createdAt_ASC</strong>" portion of the below graphql query when one of the two buttons below are clicked.</p>
  
  <p>The default order is createAt_ASC and want the user to be able to switch between them.</p>
  
  <pre><code>const ALL_ITEMS_QUERY = gql`
    query ALL_ITEMS_QUERY {
      items(orderBy: createdAt_ASC) {
        id
        title
        description
        image
      }
    }
  `;
  </code></pre>
  
  <p>Buttons:</p>
  
  <pre><code>&lt;button onClick={sortNew}&gt;Newest&lt;/button&gt;
  &lt;button onClick={sortOld}&gt;Oldest&lt;/button&gt;
  </code></pre>