# GraphQL - OrdersQuery Results in "Failed to fetch"

**URL:** <https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750>\
**Category:** Questions\
**Created:** [July 11, 2024, 5:32pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750 "2024-07-11T17:32:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 11, 2024, 5:32pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/1 "2024-07-11T17:32:34Z")

</div>

The GraphQL OrderQuery results in a “Failed to fetch” error every time. I believe this began around the 1st of July. I’d provide more details; however, even using the sample query in the GraphQL Explorer results in the same error. Does anybody have any insight into this issue?

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 11, 2024, 5:32pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/2 "2024-07-11T17:32:47Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Square GraphQL](https://developer.squareup.com/docs/devtools/graphql)**
>
> Learn how Square GraphQL queries can be used retrieve specific fields from orders, catalogs, customers, and other Square objects.

> **[GraphQL Explorer Overview](https://developer.squareup.com/docs/devtools/graphqlexplorer)**
>
> Describes Square GraphQL Explorer features and user interface, including setup steps and an overview of the schema.

> **Additional Documentation**
>
> [https://developer.squareup.com/docs/orders-api/quick-start/start](https://developer.squareup.com/docs/orders-api/quick-start/start)  
> [Handling Errors](https://developer.squareup.com/docs/build-basics/handling-errors)  
> [Orders API: How It Works](https://developer.squareup.com/docs/orders-api/how-it-works)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 11, 2024, 5:59pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/3 "2024-07-11T17:59:05Z")

</div>

I just tested the sample query and it worked as expected. Do you have any additional details or examples? 🙂

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 12, 2024, 8:04pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/4 "2024-07-12T20:04:22Z")

</div>

Here is the error I am getting from my app. This was working fine until this month.

“msg”:"ERROR: GetOrders - Error: An internal error has occurred, and the API was unable to service your request.: {"response":{"errors":[{"message":"An internal error has occurred, and the API was unable to service your request.","extensions":{"code":"OPA\_CONNECT\_ERROR"},"code":"INTERNAL\_SERVER\_ERROR"}],"data":{"orders":null},"status":200,"headers":{}}

Also, just running the sample query for GetOrders using the GraphQL Explorer tool returns “Unable to Fetch”.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 12, 2024, 9:15pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/5 "2024-07-12T21:15:29Z")

</div>

What’s your application ID? 🙂

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 15, 2024, 1:43pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/6 "2024-07-15T13:43:09Z")

</div>

sq0idp-flIS7IYBiXpIz2lLdwmzLA

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 17, 2024, 9:23pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/7 "2024-07-17T21:23:50Z")

</div>

Were you able to check into my application ID? Any ideas what the issue may be?

Thanks

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 18, 2024, 6:24pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/8 "2024-07-18T18:24:30Z")

</div>

I still haven’t been able to replicate this. What’s the full payload of the GraphQL your making. 🙂

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 24, 2024, 1:47am UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/9 "2024-07-24T01:47:04Z")

</div>

Using the GraphQL Explorer “[Square GraphQL Explorer](https://developer.squareup.com/explorer/graphql)”, with my Production instance selected and using the sample Orders query, I am now receiving the following error. This works fine in Sandbox.

“{"message":"Unexpected token ‘\<’, \"\<!DOCTYPE \"… is not valid JSON"}”

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 24, 2024, 3:52pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/10 "2024-07-24T15:52:14Z")

</div>

When you switched to production did you also switch your `merchant_id` and `location_id`? We haven’t been able to replicate this with the example query. 🙂

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 25, 2024, 8:41pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/11 "2024-07-25T20:41:54Z")

</div>

Yes - I actually got it to work. However, it only works if the “first” argument is provided. This was not the case previously and according to the sample query, it should not be required.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 26, 2024, 4:38pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/12 "2024-07-26T16:38:47Z")

</div>

Do you have a video or screen share of this? What’s the difference in the queries? 🙂

---

<div class="post-metadata">

**Author:** ![bthom2](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bthom2](https://developer.squareup.com/forums/u/bthom2)\
**Post date:** [July 29, 2024, 9:18pm UTC](https://developer.squareup.com/forums/t/graphql-ordersquery-results-in-failed-to-fetch/17750/13 "2024-07-29T21:18:27Z")

</div>

Hello, the queries are exactly the same except that the first argument is added to make it work. I have taken a screen recording and made it available at the following link: [Nextcloud](https://files.thomas-world.com/index.php/s/HJyQgeoAbqoswfe)
