I'me creating a website that is managed by Prismic and uses Nuxt 3.
Everything works fine. I can create Page-type, custom types and work with slices.
What i'm trying to do is a simple "Carousel" component thats shows some Products/Links (defined as custom types)
The carousel is made with some repeatable fields.
Welcome to Prismic community, and thanks for reaching out to us!
I apologize for just getting to this.
I suspect this is happening because the image is coming from another document. You can use GraphQuery if you want to get content from another document, or an easier solution would be to add the image directly to the carrousel. Here's our docs on GraphQuery: GraphQuery - Documentation - Prismic.
In my experience of implementing a carousel, I would do it with a Slice with an Image and a key text field.
i'm very sad about that. it will be more useful to already have the whole document if has some dependancy in it.
i'll try with GraphQuery.
Do i need to loop all the requests for all the linked documents? like, fetching GQL for every "card" inside my carousel, or there is a way to fetch all the linked document, passing the ID (or something else)?
You’ll need to specify exactly what you want from the document through the content relationship. This means you’ll only be able to get content from one document type and always the same content.
GraphQuery is the best way to fetch the data; you'll also have to use content relationships.
We have to use GraphQuery to specify what we want because returning all linked documents by default could potentially cause performance issues for the API.
The only other option is to query all the documents you need on your homepage in a separate query.