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