GraphQL API search returns 502 errors

I’m using ghql package in R to send requests to get repos under a certain license during several specific time frames. I am getting a 502 Server Error sporadically, especially when the result contains more than 200 results, but the query works fine in the GraphQL API Explorer.
I have tried setting up waiting time between requests in my script, and have also run it at different time by different users. I have see posts about API calls timeout like this and this, but still want to see if anyone experiencing similar problems has suggestions of how to work around this?
Below is my query in case it helps. Thanks!

{
  rateLimit {
    cost
    remaining
    resetAt
  }
  search(query: "license:mit created:2008-01-01..2008-03-31", type: REPOSITORY, first: 10) {
    repositoryCount
    pageInfo {
      endCursor
      startCursor
      hasNextPage
    }
    nodes {
      ... on Repository {
        defaultBranchRef {
          target {
            ... on Commit {
              history(first: 10) {
                totalCount
                pageInfo {
                  startCursor
                  endCursor
                  hasNextPage
                }
                nodes {
                  additions
                  deletions
                }
              }
            }
          }
        }
      }
    }
  }
}

Hi @ccong2,

Apologies for the delay in reponse, are you still experiencing this issue?