title: GraphQL with AWS Amplify - how to enable sorting on query
body: <p>I've recently started looking into AWS Amplify.
  I have managed to setup an API using GraphQl.
  Basically, during the API creation, Amplify ask you a few questions about the API and guides you through its creation.
  At some point, you are requested to create a schema. The schema I selected is as follows:</p>
  
  <pre><code>type User @model {
    id: ID!
    username: String!
    email: String
  }
  
  type Highscore @model {
    points: Int!,
    id: ID!
    ownerId: ID!,
    numRounds: Int,
    date: String, 
  }
  </code></pre>
  
  <p>with this schema, Amplify is able to generate code that allows me to do things such as:</p>
  
  <ul>
  <li>mutate users and highscores</li>
  <li>query all Users</li>
  <li>query all Highscores</li>
  </ul>
  
  <p>Does anyone know how I could achieve this?</p>
  
  <p>I've looked into the @key directive (<a href="https://aws-amplify.github.io/docs/cli-toolchain/graphql#key" rel="nofollow noreferrer">https://aws-amplify.github.io/docs/cli-toolchain/graphql#key</a>) but updating the schema to include</p>
  
  <pre><code>type Highscore @model @key((fields: ["points"] {
  ...
  }
  </code></pre>
  
  <p>did not produce the expected result.</p>
  
  <p>unfortunately, the code generated by Amplify using this schema <strong>does not allow sorting of the query</strong>.</p>
  
  <p><strong>I would like to be able to query all Highscores, and sort it according to the number of points.</strong></p>