# Bug in GraphQuery API

**URL:** <https://community.prismic.io/t/bug-in-graphquery-api/13149>\
**Category:** Developing with Prismic\
**Tags:** graphquery\
**Created:** [May 19, 2023, 9:00am UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149 "2023-05-19T09:00:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.vanderheide](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@s.vanderheide](https://community.prismic.io/u/s.vanderheide)\
**Post date:** [May 19, 2023, 9:00am UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149/1 "2023-05-19T09:00:55Z")

</div>

Hello,

I found a bug in the GraphQuery API. When using it as below to retrieve multiple content relationships I'm getting the error `an invalid api response was returned`. This doesn't happen when I replace `...secondFields` with the name of the first field of the document. It does happen when I also add the name of the second field. The first content relationship is working without any issues. When adding the second one as described I'm getting the error.

Is this a known issue? I would be very happy if this can be solved.

Kind regards,  
Sian

```auto
...
...on slice name {
          variation {
            ...on default {
              primary {
                ...primaryFields
              }
              items {
                ...itemsFields
              }
            }
            ...on variationName {
              primary {
                ...primaryFields
                first {
                  ...firstFields
                }
                second {
                  ...secondFields
                }
              }
              items {
                ...itemsFields
              }
            }
          }
        }
...

```

---

<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:** [May 19, 2023, 3:43pm UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149/3 "2023-05-19T15:43:32Z")

</div>

Are first and second the correct API IDs of the content fields inside the non-repeatable zone of your slice?

---

<div class="post-metadata">

**Author:** ![s.vanderheide](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@s.vanderheide](https://community.prismic.io/u/s.vanderheide)\
**Post date:** [May 22, 2023, 8:01am UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149/4 "2023-05-22T08:01:17Z")

</div>

Yes, when I try both separately there are no issues retrieving the data of the specific content relationship.

---

<div class="post-metadata">

**Author:** ![s.vanderheide](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@s.vanderheide](https://community.prismic.io/u/s.vanderheide)\
**Post date:** [May 22, 2023, 8:59am UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149/5 "2023-05-22T08:59:54Z")

</div>

I found the issue. My GraphQuery was too long. Because of the fact that I have a couple of content relationships I have to add every created slice to the query which now, causes issues.  
Wouldn't it be better if content relationships are automatically linked without the need of adding the GraphQuery?

---

<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:** [May 23, 2023, 5:42pm UTC](https://community.prismic.io/t/bug-in-graphquery-api/13149/7 "2023-05-23T17:42:33Z")

</div>

Glad to hear that it worked for you!  
I understand that the query syntax can become lengthy if the content query is extensive. At the moment, there are no plans to modify the structure of the schema.

We're always open to hearing from our users and exploring ways to enhance the developer experience. If you have any other questions or need further assistance, please let me know.
