Nuxt : how to use fetchLinks with $prismic.api.query

Hi,
I'm using $prismic.api.query to retrieve the news of my website like this

  const prismicActualites = await $prismic.api.query(
    $prismic.predicates.at('document.type','actualite'),
    {
      lang: localeForPrismic,
      pageSize:5,
      page:1, 
      orderings: '[my.actualite.date desc]' 
    },
  );

and I would like to retrieve at the same time data from another customType : fetchLinks: 'general.boutonLireArticle'

But I don't know where to put this in the query above ?

Hello @ricou, thanks for reaching out.

You can add fetchLinks line any other query option.

  const prismicActualites = await $prismic.api.query(
    $prismic.predicates.at('document.type','actualite'),
    {
      lang: localeForPrismic,
      pageSize:5,
      page:1, 
      orderings: '[my.actualite.date desc]',
      fetchLinks: 'general.boutonLireArticle'
    },
  );
1 Like

Thank you

1 Like