How do I resolve relationships/references to other pages and fetch their content on a page query in Nuxt?

How would you do this kind of query inside of Nuxt within asyncData? So, I have a slice called FeaturedPages, which has repeatable fields of links to other pages. In this component of FeaturedPages I wanna be able to output data from each of the page added/linked, data such as the "FeaturedImage", which is a field in each page.

On the page, home in this instance, where this FeaturedPages slice is called, I've done like so

const page = await $prismic.api.getByUID('page', 'home', { fetchLinks: 'page.featured_pages' })

But page returns without the data object, from where I could've gotten to for example.

This is like a case of resolving all relationships/references on a page when it is queried. How do I do that in Nuxt?


Thanks. I'd greatly appreciate help here as I'm stuck and can't move forward on a client's project.

Hi @Pau or anyone who can help, I've not been able to move forward on this and it's been two weeks since. I'm not getting how to resolve relationship of referenced page in a slice and no amount of trial and error has helped yet. Can someone please assist in looking over?

Hi @kb1

This is Fares from the Support team, and I will try to investigate this with you.
To do so, can you please share in a private message a zip file of your code base to be able to test it locally or otherwise add me to your Project (for example, on GitHub).

looking forward to your reply,

1 Like

Thanks, @Fares let me do as directed.

1 Like

Thanks @kb1
I have recieved the private message