Home

GraphQL Sort Return Values In Gatsby

To sort the return value of a query use:

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