# Querying content relationship within a Slice repeatable zone using Prismic API

**URL:** <https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891>\
**Category:** Developing with Prismic\
**Created:** [November 26, 2020, 4:28pm UTC](https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891 "2020-11-26T16:28:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://community.prismic.io/u/ian)\
**Post date:** [November 26, 2020, 4:28pm UTC](https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891/1 "2020-11-26T16:28:56Z")

</div>

We are using the Prismic API to query our data through javascript. When querying a page we are retrieving slices from the body, in some slices there are content relationships within the slice repeatable zone but this only returns the id of the custom type the slice is linked to. Is there a way from retrieving all the data from the linked custom type without having to query the ID separately.

Query for context - client.query(Prismic.Predicates.at("my.product\_page.uid", "test-product"))

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [November 30, 2020, 8:42am UTC](https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891/3 "2020-11-30T08:42:41Z")

</div>

Hello Ian,

Thanks for reaching out to us.

In this case, you need to add fetchLinks option to get the required fields from the linked custom\_type. The fetchLinks option allows you to retrieve a specific content field from a linked document and add it to the document response object.

Here is an example:

`const doc = await client.getByUID('post', uid, {'fetchLinks': 'author.author.name'});`

You will find more detail [here](https://prismic.io/docs/technologies/fetch-linked-document-fields-reactjs).

Let me know if you have any doubt.

Thanks,  
Priyanka

---

<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 14, 2020, 2:23pm UTC](https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891/4 "2020-12-14T14:23:06Z")

</div>

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, 12:54pm UTC](https://community.prismic.io/t/querying-content-relationship-within-a-slice-repeatable-zone-using-prismic-api/2891/5 "2021-12-09T12:54:39Z")

</div>


