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

Highlighted
Tourist
7 1 0

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?

0 Likes
Highlighted
Shopify Partner
40 3 14

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? 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
123 15 19

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 | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Tourist
7 1 0

@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

0 Likes