Hey @Samantha,
Here's an example:
- You're querying
page-one
-
page-one
has a "title" field and a "relationship" field
-
page-one
's relationship field is filled in with a link to page-two
-
page-two
has a relationship field that you want to retrieve with fetchLinks
- The relationship field on
page-two
is filled in with a link to page-three
Then, your JSON response should look like this:
{
"page": 1,
"results_per_page": 20,
"results_size": 1,
"total_results_size": 1,
"total_pages": 1,
"next_page": null,
"prev_page": null,
"results": [
{
"id": "YArUdREAACoASlF1",
"uid": "one",
"type": "page",
"href": "https://recursive-fetchlinks.cdn.prismic.io/api/v2/documents/search?ref=YA6ahBEAACgAWxAu&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22YArUdREAACoASlF1%22%29+%5D%5D",
"tags": [],
"first_publication_date": "2021-01-22T13:34:49+0000",
"last_publication_date": "2021-01-25T10:12:06+0000",
"slugs": ["page-one", "one"],
"linked_documents": [],
"lang": "en-us",
"alternate_languages": [],
"data": {
"title": "Page One",
"relationship": {
"id": "YArUaBEAACoASlE3",
"type": "page",
"tags": [],
"slug": "page-two",
"lang": "en-us",
"uid": "two",
"data": {
"relationship": {
"id": "YArUWREAACoASlDq",
"type": "page",
"tags": [],
"slug": "page-three",
"lang": "en-us",
"uid": "three",
"link_type": "Document",
"isBroken": false
}
},
"link_type": "Document",
"isBroken": false
}
}
}
],
"version": "ec04165",
"license": "All Rights Reserved"
}
Right now, the only different is that page-three
also has a data
object with a relationship
property displaying corrupt data.
Let me know if that makes sense! I hope this is helping you getting everything sorted. In any case, I'm around if you have more questions.
Sam
PS: If you want to play with the data in the API, you can use the repo I'm using in that example, recursive-fetchlinks.prismic.io/api/v2