Hey, currently I'm fetching articles data by prismic.api.query(), however, I have no idea how I could add ordering parameter to that query.
My current code:
const response = <PrismicApiResponse>await $prismic.api.query(
$prismic.predicates.at('document.type', 'article'),
{
lang: i18n.localeProperties.iso,
page: query?.page ? query.page : 1,
pageSize: 7,
fetchLinks: 'author.fullname, author.uid',
ordering: {
field: 'document.first_publication_date',
},
},
);
When I add the ordering object to that settings I get an error Unknown field ordering . So my question is: How can I combine query with ordering?