Limit Fetchlinks number on group field

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.

Hello @andri.bakoson, you need to use the pageSize query option to define the number of documents you need in the response: