Wasn't quick to find the official documentation for this, so here it is in case you're wondering.
Single field sorting
sort: {
order: ASC,
fields: frontmatter___season
}
Code language: CSS (css)
Multiple field sorting
You can define an array of values for both
order an fields
.
sort: {
order: [ASC, ASC],
fields: [frontmatter___season, frontmatter___episode]
}
Code language: CSS (css)
My full working query for printing a list of TV Shows ordered by season and then by the episode number.
query MyQuery { allMarkdownRemark( sort: { order: [ASC, ASC], fields: [frontmatter___season, frontmatter___episode] } ) { edges { node { id frontmatter { title } } } } }