Hello,
I have a function which queries a collection of Category
documents with all their Article
group field and want to only query the last 3 articles for each category. Didn't find any good example on that. Here is my function.
export const getCategories = async () => {
const categories = await getClient().getAllByType('category', {
orderings: {
field: 'document.first_publication_date',
direction: 'desc',
},
fetchLinks: 'article.thumbnail,article.title',
})
return categories
}
This only queries all of the Article
documents group field for now.