GraphQL Sort Return Values In Gatsby

February - 2021

To sort the return value of a query use:

query MyQuery {
  allMdx(sort: {fields: frontmatter___date, order: DESC}) {
    edges {
      node {
        id
        frontmatter {
          title
          type
        }
      }
    }
  }
}