A snippet with GraphQL to select all posts, ordered by the order field of the frontmatter.

query AllPosts {
  allMdx (
      filter:{
          fields:{slug: {regex: "/^/posts//" } }
      },
      sort: {
          fields: [frontmatter___order]
          order: ASC
      }          
  ){
    edges {
      node {
        frontmatter{
            title
            keywords
        }
        fields {
            slug
        }
        excerpt
      }
    }
  }
}