Get document data from link field in slice

Hi team,

Could you please clarify, if we can get all data for the document we point to in the "link" filed in slice? I mean all that we have in "Static Zone" area in custom type.

For example:

  • We have slice with "link" field
  • In Prismic we add this slice, in "link" field we attach the needed document
  • On frontend we receive only it's title in slice.primary.url.data

So is it possible to get everything from the linked document "Static Zone" in this field? Or maybe I missed something?)

I really appreciate any help you can provide.
Thank you.

When you retrieve the data from a linked document, you will only get the top-level fields of the linked document.

To get additional data from the linked document, such as the content in the "Slice Zone" area, you will need to use GraphQuery. GraphQuery allows you to fetch specific data from linked documents and include it in your response.

1 Like