title: How can I sort a GraphQL query based on the frontmatter
body: <p>I am new to <code>GraphQL</code> and have successfully sorted data with an <code>allMarkDownRemark</code> query, however what I need is to be able to us a <code>allFile</code> query and then still sort by the <code>frontmatter</code>, is this possible? </p>
  
  <p>This is the query which (with the sort removed) returns the correct data.</p>
  
  <pre><code>{
      allFile(
        limit: 3
        sort: { fields: [frontmatter___priority], order: DESC }
        filter: { sourceInstanceName: { eq: "key-points" } }
      ) {
        edges {
          node {
            id
            childMarkdownRemark {
              frontmatter {
                title
                content
                priority
              }
            }
          }
        }
      }
    }
  </code></pre>
  
  <p>When I run it with the sort in like I above it throws the following error</p>
  
  <pre><code>    {
    "errors": [
      {
        "message": "Expected type FileConnectionSortByFieldsEnum, found frontmatter___priority.",
        "locations": [
          {
            "line": 4,
            "column": 28
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>Firstly is there a way to query using <code>AllFile</code> and then sort via the <code>frontmatter</code>? </p>
  
  <p>If not then is there a way to filter a specific folder with markdown info without a <code>path</code> field?</p>