Мне нужно изменить порядок страниц моих сообщений в блоге, чтобы новые сообщения упорядочивались сверху, а не снизу.
В настоящее время старые сообщения находятся вверху страницы.
Вот мой Гэтсби- node.js. Как я могу отменить заказ?
const path = require('path');
// registering our posts
exports.createPages = ({ boundActionCreators, graphql }) => {
const { createPage } = boundActionCreators;
const postTemplate = path.resolve('src/templates/blog-post.js');
return graphql(`
{
allMarkdownRemark {
edges {
node {
html
id
frontmatter {
path
title
date
author
}
}
}
}
}
`).then(res => {
if (res.errors) {
return Promise.reject(res.errors);
}
res.data.allMarkdownRemark.edges.forEach(({ node }) => {
createPage({
path: node.frontmatter.path,
component: postTemplate,
});
});
});
};