# Graph Query: Get Relationship inside Repeatable inside Slice of Page

**URL:** <https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516>\
**Category:** Developing with Prismic\
**Tags:** graphquery, custom-types-api, fetch-linked-content\
**Created:** [March 9, 2025, 5:08am UTC](https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516 "2025-03-09T05:08:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrsebastienleblanc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mrsebastienleblanc/32/8250_2.png) [@mrsebastienleblanc](https://community.prismic.io/u/mrsebastienleblanc)\
**Post date:** [March 9, 2025, 5:08am UTC](https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516/1 "2025-03-09T05:08:40Z")

</div>

Hi,  
As the title says, I have a "home" Page (Single Type), which has a "home\_tickets" Slice.  
This slice has a "tickets" Repeatable Group, this group has a single "ticket\_type" Content Relationship field. This relationship has a few basic fields like a "name, price, link, etc..."

No matter how hard I try, I cannot figure out to get the fields of the relationship using Graph Query.  
Here is my query:

```js
const { data: page } = useAsyncData('home', () => {
    return prismic.client.getSingle('home', {
        graphQuery: `{
          home {
            slices {
              ...on home_tickets {
                variation {
                  ...on default {
                    primary {
                      tickets {
                        ...on ticket_type {
                          name
                          price
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }`,
        lang: "fr-ca",
    });
});

```

Here is the "home" customtype:

```json
{
    "format": "page",
    "id": "home",
    "label": "Home",
    "repeatable": false,
    "status": true,
    "json": {
        "Main": {
            "slices": {
                "type": "Slices",
                "fieldset": "Slice Zone",
                "config": {
                    "choices": {
                        "home_tickets": {
                            "type": "SharedSlice"
                        },
                        "partners_grid": {
                            "type": "SharedSlice"
                        },
                        "home_programming": {
                            "type": "SharedSlice"
                        }
                    }
                }
            }
        },
        "SEO & Metadata": {
            "meta_title": {
                "config": {
                    "label": "Meta Title",
                    "placeholder": "A title of the page used for social media and search engines"
                },
                "type": "Text"
            },
            "meta_description": {
                "config": {
                    "label": "Meta Description",
                    "placeholder": "A brief summary of the page"
                },
                "type": "Text"
            },
            "meta_image": {
                "config": {
                    "constraint": {
                        "height": 1260,
                        "width": 2400
                    },
                    "label": "Meta Image",
                    "thumbnails": []
                },
                "type": "Image"
            }
        }
    }
}

```

Here is the "home\_tickets" slice model:

```json
{
  "id": "home_tickets",
  "type": "SharedSlice",
  "name": "HomeTickets",
  "description": "HomeTickets",
  "variations": [
    {
      "id": "default",
      "name": "Default",
      "docURL": "...",
      "version": "initial",
      "description": "Default",
      "imageUrl": "",
      "primary": {
        "title": {
          "type": "Text",
          "config": {
            "label": "title",
            "placeholder": ""
          }
        },
        "tickets": {
          "type": "Group",
          "config": {
            "label": "tickets",
            "repeat": true,
            "fields": {
              "ticket_type": {
                "type": "Link",
                "config": {
                  "label": "ticket_type",
                  "select": "document",
                  "repeat": false,
                  "customtypes": [
                    "ticket_types"
                  ]
                }
              }
            }
          }
        }
      },
      "items": {}
    }
  ]
}

```

Here is the "ticket\_type" customtype:

```json
{
    "format": "custom",
    "id": "ticket_types",
    "label": "Ticket types",
    "repeatable": true,
    "status": true,
    "json": {
        "Main": {
            "uid": {
                "type": "UID",
                "config": {
                    "label": "UID"
                }
            },
            "name": {
                "type": "Text",
                "config": {
                    "label": "name",
                    "placeholder": ""
                }
            },
            "price": {
                "type": "Number",
                "config": {
                    "label": "price",
                    "placeholder": ""
                }
            },
            "inclusions": {
                "type": "Group",
                "config": {
                    "label": "inclusions",
                    "repeat": true,
                    "fields": {
                        "item": {
                            "type": "Text",
                            "config": {
                                "label": "item",
                                "placeholder": ""
                            }
                        }
                    }
                }
            },
            "link": {
                "type": "Link",
                "config": {
                    "label": "link",
                    "placeholder": "",
                    "select": null,
                    "allowTargetBlank": false,
                    "allowText": false,
                    "repeat": false
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![mrsebastienleblanc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mrsebastienleblanc/32/8250_2.png) [@mrsebastienleblanc](https://community.prismic.io/u/mrsebastienleblanc)\
**Post date:** [March 9, 2025, 5:24am UTC](https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516/2 "2025-03-09T05:24:01Z")

</div>

Currently, this query returns an HTTP 400 Bad Request with absolutely no pointer to what is wrong.

---

<div class="post-metadata">

**Author:** ![mrsebastienleblanc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mrsebastienleblanc/32/8250_2.png) [@mrsebastienleblanc](https://community.prismic.io/u/mrsebastienleblanc)\
**Post date:** [March 9, 2025, 6:38am UTC](https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516/3 "2025-03-09T06:38:28Z")

</div>

I got it working like this, but not it only returns my "home\_tickets" slice and not any of my other slices:

```js
const { data: page } = await useAsyncData('index', () => {
    return prismic.client.getSingle('home', {
        graphQuery: `{
            home {
                slices {
                    ...on home_tickets {
                        variation {
                            ...on default {
                                primary {
                                    ...primaryFields
                                    tickets {
                                        ticket_type {
                                            ...ticket_typeFields
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }`,
        lang: `${locale.value}-ca`,
    });
});

```

I tried adding `...sliceFields` but it did not work.  
Not sure if I'm required to redefine all the fields inside the graphQuery now

---

<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:** [March 13, 2025, 3:22am UTC](https://community.prismic.io/t/graph-query-get-relationship-inside-repeatable-inside-slice-of-page/18516/4 "2025-03-13T03:22:07Z")

</div>

lad to hear you got the first part working!

Have you tried using `...items` to access the repeatable zone inside the slice? like this:

```auto
tickets {
  ...items
}

```

We have an example of this query [in the docs](https://prismic.io/docs/graphquery-rest-api#all-fields-from-a-slice-created-with-slice-machine), where fields inside a repeatable zone in Slice Machine are accessed using items instead of primary
