# Help: FetchLinks with Slices | Node Js Client

**URL:** <https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537>\
**Category:** Developing with Prismic\
**Created:** [January 6, 2022, 10:54am UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537 "2022-01-06T10:54:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [January 6, 2022, 10:54am UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/1 "2022-01-06T10:54:47Z")

</div>

Hi, I need help with:

1 - Use fetch links with Slices  
2 - Need a way to do this with the Javascript Client

Is there a way to do this?

We're planning to move to Prismic very soon so quick response will be highly appreciated.

Thanks alot

---

<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:** [January 6, 2022, 11:27am UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/3 "2022-01-06T11:27:25Z")

</div>

Hello @thesrs02

Welcome to the Prismic community, and thanks for reaching out to us.

FetchLinks doesn't support retrieving any fields in the Slices or group. To retrieve fields from Slices, fetchLinks v2 works, which is known as graphQuery. And you can use it with javascript client too.

Find more details about how to implement graphQuery, in the following article:

> **[API reference for GraphQuery (fetchLinks v2)](https://prismic.io/docs/technologies/graphquery-rest-api#retrieve-fields-in-a-slice)**
>
> This shows how to use the Prismic GraphQuery query option to retrieve certain fields and retrieve content from linked documents.

Let me know if you have any further questions related to it.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [January 6, 2022, 12:15pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/4 "2022-01-06T12:15:33Z")

</div>

Thanks @Priyanka

---

<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:** [January 6, 2022, 12:54pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/5 "2022-01-06T12:54:19Z")

</div>

@thesrs02 Your welcome. Feel free to reach out to us if you have any questions.

---

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [January 19, 2022, 2:18pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/7 "2022-01-19T14:18:22Z")

</div>

Hi @Priyanka,

Thanks for your quick help with my earlier question. I need a little more help to make the graphQuery work.

**My Structure** :  
Type =\> Slice (repeatable group) =\> Content Relationship =\> Product Type =\> Integration Field (shopify)

All I'm looking for is to get the body of linked products.

**I'm getting this error** : "Unable to parse fetch query Invalid fetch parsing Exception.\n\nThe fragment ...product\_linkFields doesn't correspond to it's parent product"

**Query** :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/7/792366d88a39c3ad62374c68e70d7ac3cb4973da.png)

**Prismic Model (UI)**:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/e/e9cc85ecc4dfab376e81d71a2260f6ec03ead0d4.png)

**API Response** : [https://cycleboard.cdn.prismic.io/api/v2/documents/search?ref=YcFYhRYAAC8AXcs3&integrationFieldsRef=cycleboard~f126e32f-a972-4790-90ca-d1cbbcd078e9&q=[[%3Ad+%3D+at(document.id%2C+"Ybso5hUAAC4AronB")+]]](https://cycleboard.cdn.prismic.io/api/v2/documents/search?ref=YcFYhRYAAC8AXcs3&integrationFieldsRef=cycleboard%7Ef126e32f-a972-4790-90ca-d1cbbcd078e9&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22Ybso5hUAAC4AronB%22%29+%5D%5D)

Can you help? Thanks in advance

---

<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:** [January 19, 2022, 5:49pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/8 "2022-01-19T17:49:44Z")

</div>

Hello @thesrs02

Thanks for getting back to us.

There are two mistakes I found in your query:

1. You need to mention the type of linked document after the content relationship field.
2. To get all the fields from a linked document, use the _fragment_ syntax. It is done by adding `...` before and `Fields` after the name of the Custom Type. In your case, it should be .`..productFields` not `...product_linkFields`

The correct query looks like this:

```auto
{
  collection {
    body {
      ... on products_group {
        repeat {
          product {
            ... on product { //type of linked document
              ...productFields 
            }
          }
        }
      }
    }
  }
}

```

It will solve your issue. Let me know if you have any other questions.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [January 19, 2022, 7:15pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/9 "2022-01-19T19:15:58Z")

</div>

Thanks SO much @Priyanka!

It works. I can see all product fields in the response now.

Two questions:

1 - Is there a way to select specific fields from the response. I tried the followings but to no avail. I get a bad request error.

2 - Is there a way to get an unfolded response with this query? For example, having the products in the data field of the response body?

Attempt 1:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/1/1bc396b0a667e7d0a9bc7ee0bb8b973a4415e1ee.png)

Attempt 2:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/c/ca97f57b5734e3fa3b6030eefce3dcf6a952db77.png)

I must be missing something here but I would really appreciate your help with this if possible.

Thanks again for the awesome support!

---

<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:** [January 20, 2022, 1:30pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/11 "2022-01-20T13:30:42Z")

</div>

Hello @thesrs02

It's not possible to fetch a specific field within an Integration field. It will retrieve everything inside IF.

Let me know if you have any other questions.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [January 20, 2022, 1:41pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/12 "2022-01-20T13:41:46Z")

</div>

Thanks again @Priyanka

---

<div class="post-metadata">

**Author:** ![kb1](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/kb1/32/4961_2.png) [@kb1](https://community.prismic.io/u/kb1)\
**Post date:** [September 1, 2022, 6:17pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/14 "2022-09-01T18:17:29Z")

</div>

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

```auto
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 `item.data.featuredImage` 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.

---

<div class="post-metadata">

**Author:** ![kb1](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/kb1/32/4961_2.png) [@kb1](https://community.prismic.io/u/kb1)\
**Post date:** [September 3, 2022, 1:19pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/16 "2022-09-03T13:19:17Z")

</div>

Hi, @erik.israni, would you be able to take a look and unstuck me here? Would greatly appreciate. Thanks.

---

<div class="post-metadata">

**Author:** ![thesrs02](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/thesrs02/32/4964_2.png) [@thesrs02](https://community.prismic.io/u/thesrs02)\
**Post date:** [September 4, 2022, 9:04am UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/17 "2022-09-04T09:04:18Z")

</div>

@kb1 - Maybe you'll find this helpful: [Help | "ParsingError: Unable to parse fetch query Invalid fetch parsing Exception" - #2 by Phil](https://community.prismic.io/t/help-parsingerror-unable-to-parse-fetch-query-invalid-fetch-parsing-exception/10854/2)

---

<div class="post-metadata">

**Author:** ![erik.israni](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/erik.israni/32/2824_2.png) [@erik.israni](https://community.prismic.io/u/erik.israni)\
**Post date:** [September 6, 2022, 3:53pm UTC](https://community.prismic.io/t/help-fetchlinks-with-slices-node-js-client/8537/18 "2022-09-06T15:53:55Z")

</div>

Hey @kb1 let me know if @thesrs02 's note was helpful. If you are still stuck, start a new thread and tag me, and we'll get into it.
