# Fetch deep content relationship using javascript library

**URL:** <https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952>\
**Category:** Developing with Prismic\
**Created:** [September 22, 2020, 9:41am UTC](https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952 "2020-09-22T09:41:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasper](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jasper](https://community.prismic.io/u/jasper)\
**Post date:** [September 22, 2020, 9:41am UTC](https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952/1 "2020-09-22T09:41:45Z")

</div>

Hey,

I've got a situation where I've got a content relationship within a content relationship. When I try to access the deepest content relationship (a custom type named 'button'), it only gives me the ID back, which makes sense as I don't have it defined in the 'fetchLinks' options.

I am using the Prismic Javascript Library with Nuxt.js

```auto
   await $prismic.getSingle('type', {
     fetchLinks: [
       'button.button_link',
       'button.button_text',
       'deeprelation.button.button_link',
       'deeprelation.button.button_text',
     ]
   });

```

Currently I receive this, where button\_link is not a Document type, but just an ID

 ![Schermafbeelding 2020-09-22 om 11.38.12](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/c70b67a7b7157577822d0e6216241cae367332a6.png)

I want to receive something like this, so I can make the button link to another page.

 ![Schermafbeelding 2020-09-22 om 11.40.09](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/a2c09c3e5d7f30e9f3010bd20a4ef7736d0ec8a1.png)

How can I get the button data of the button in the 'deeprelation' field? I've been struggling to find an answer to this.

Thanks for checking this out 🙂

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [September 23, 2020, 2:56am UTC](https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952/2 "2020-09-23T02:56:17Z")

</div>

Hello Jasper!

Thank you for reaching out and welcome to the forum

FetchLinks allows you to retrieve a specific content field from a linked document. But, if this linked document has another linked document inside of it you'll have to perform another query. One that, in your case gets the 'Button' custom type first by doing a Query by Content relationship field and then again use fetchlinks to get the desired field from the 'nested' document.

> **[Query by a Content Relationship field with Vue.js - Prismic](https://prismic.io/docs/vuejs/query-the-api/query-by-content-relationship)**

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [September 24, 2020, 2:56am UTC](https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952/3 "2020-09-24T02:56:17Z")

</div>

closed on September 24, 2020, 2:56am UTC as resolved,  flag & select 'Something Else' to reopen.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:19pm UTC](https://community.prismic.io/t/fetch-deep-content-relationship-using-javascript-library/1952/4 "2021-12-09T17:19:13Z")

</div>

Opened on December 9, 2021, 5:19pm UTC


