Sort books by rating.
This commit is contained in:
@@ -12,6 +12,10 @@ exports.createPages = async function ({ actions, graphql }) {
|
||||
eq: $categoryName
|
||||
}
|
||||
}
|
||||
sort: {
|
||||
fields: [rating]
|
||||
order: DESC
|
||||
}
|
||||
){
|
||||
edges {
|
||||
node {
|
||||
|
||||
@@ -43,7 +43,12 @@ export default ({ data }) => {
|
||||
|
||||
export const query = graphql`
|
||||
query MyQuery {
|
||||
allBooksJson {
|
||||
allBooksJson(
|
||||
sort: {
|
||||
fields: [rating]
|
||||
order: DESC
|
||||
}
|
||||
) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
|
||||
Reference in New Issue
Block a user