To sort the return value of a query use:
query MyQuery { allMdx(sort: {fields: frontmatter___date, order: DESC}) { edges { node { id frontmatter { title type } } } } }