GraphQL API throws 500 after a certain number of transactions are retrieved

Hi, I’ve been using the GraphQL API to pull transaction data across ~50 locations. I’ve been retrieving 200 records at a time, by the time I get to the ~10th call by passing in the previous end cursor I get the following error from the API:

{
    "errors": [
        {
            "code": "INTERNAL_SERVER_ERROR",
            "message": "500: Internal Server Error",
            "extensions": {
                "response": {
                    "url": "http://localhost/graphql",
                    "status": 500,
                    "statusText": "Internal Server Error",
                    "body": {
                        "success": false,
                        "title": null,
                        "message": {
                            "resource_bundle_name": "com.squareup.webservice.WebserviceMessages",
                            "key": "there.was.a.problem.processing.this.request",
                            "arguments": []
                        },
                        "debug_info": ""
                    }
                }
            }
        }
    ],
    "data": {
        "orders": null
    }
}

Is there any additional logging on the Square side that might help figure out what’s happening here? Thank you!

Whats your application ID and what’s the query your getting this error with? :slightly_smiling_face:

App id is : sq0idp-K9Fb3agz_H3j1jRw75d0rw
Query is:

query($merchantId: ID!, $yesterday_midnight: DateTime, $latest_midnight: DateTime){
  orders(
    filter: {merchants: {equalToAnyOf: [ $merchantId ]}, locations: {equalToAnyOf: [/All of the locations under my merchant/]}, createdAt: {startAt: $yesterday_midnight, endAt: $latest_midnight}, states: {equalToAnyOf: [CANCELED, COMPLETED]}}, first: 200
  ) {
    nodes {
      id
      state
      createdAt
      discounts {
        name
      }
      source {
        name
      }
      tenders {
        type
      }
      totalTax {
        amount
      }
      totalTip {
        amount
      }
      totalMoney {
        amount
      }
      totalDiscount {
        amount
      }
      lineItems {
        name
        modifiers {
          name
        }
      }
      location {
        id
      }
    }
    pageInfo {
        hasNextPage
        endCursor
    }
  }
}
{
  "merchantId": "stripped id",
  "latest_midnight": "2023-03-29T00:00:00+00:00",
  "yesterday_midnight": "2023-03-28T00:00:00+00:00"
}

Are you able to regularly reproduce this error? I just tried your query will all 54 of your locations and it worked as expected. :slightly_smiling_face:

Yes, it happens on the 10th query with the previous endCursor.