GraphQL "Internal Error" on some shops, but works for others

bestrada
Tourist
12 2 1

I am the developer of this app and when using the GraphQL API I have mixed success between different merchants. Here's the content of my GraphQL request:

{
  orders(first:10, query:"sortKey:CREATED_AT, reverse:true") {
    edges {
      node {
        id, legacyResourceId, name, createdAt, cancelledAt, cancelReason, email
        shippingAddress { zip }
        lineItems(first:25) {
          edges {
            node { id, sku, quantity }
          }
        }
        fulfillments {
          legacyResourceId
          fulfillmentLineItems(first:25) {
            edges {
              node {
                id
                lineItem { id }
              }
            }
          }
        }
      }
    }
  }
}

 

It succeeds with many shops, but with other shops using a valid access token with the correct scopes I get this unhelpful message:

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 2df8c6cb-bac8-41a3-a591-a7c65c7033f0 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "2df8c6cb-bac8-41a3-a591-a7c65c7033f0"
      }
    }
  ]
}

 

Can someone help me figure out what is wrong here?

Replies 3 (3)

Martin_Caum
Shopify Partner
40 3 22

For the stores that it fails on, does it fail every time? The error message you are showing that you are receiving is inline with the HTTP code 500 which typically is an issue on the server end, not anything with your call. Though, it could be something with the data getting sent with the call. I imagine so (and understand they are not always the most helpful or responsive), but have you directly contacted Shopify support outside of this forum? This sounds like something they need to fix, not you. Though I cannot say that for sure.

To further QA on your side though, have you tried logging the data sent from successful and failing calls to compare and make sure there are no discrepancies? 

Kevin_A
Shopify Staff
318 42 61

Hey @bestrada 

It looks like a timeout on our end is causing the server error. I don't believe we document the use of "sortKey" so that could potentially be an issue if there are a large amount of orders for the shop you are querying. If you remove the "sortKey" param from the query, does the error still occur? 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

bestrada
Tourist
12 2 1

@Kevin_A thanks for the reply.sortkey.jpg

 

 

 

sortKey is documented in your GraphQL "admin tool" and enumerates the following options:

sortkey_options.jpg

After removing that parameter, the same problem persists. If it helps, I also have a customer support ticket (id=19112157) pending a response from email where I have been more candid about the specific identifiers and other sensitive information.

[edited] added link to documentation/admin tool