500 in Explorer


#1

I’m continuously getting 500 response when using next (and similar) API request:

{
  search(first: 10, query: "location:italy", type: USER) {
    nodes {
      ... on User {
        avatarUrl
        createdAt
        login
        name
        bio
        email
        company
        isHireable
        location
        websiteUrl
        repositories(isFork: false, orderBy: {field: STARGAZERS, direction: DESC}, privacy: PUBLIC) {
          totalCount
        }
        following {
          totalCount
        }
        followers {
          totalCount
        }
        gists {
          totalCount
        }
        gistComments {
          totalCount
        }
        issueComments {
          totalCount
        }
        issues {
          totalCount
        }
        organizations {
          totalCount
        }
        pinnedRepositories {
          totalCount
        }
        pullRequests {
          totalCount
        }
        repositoriesContributedTo(privacy: PUBLIC) {
          totalCount
        }
        starredRepositories {
          totalCount
        }
        watching {
          totalCount
        }
      }
    }
    userCount
  }
  rateLimit {
    limit
    cost
    remaining
    resetAt
  }
}

When I’m trying to get less data, it works.

What am I doing wrong?

Thank you!


#2

Hi @miroshnik!

I don’t believe you’re doing anything wrong! In this case, the query you’re requesting is asking for so much data that it’s taking too long for our platform to execute. We have a multitude of safeguards in place to ensure that no single request is capable of monopolizing too many system resources - while we try our hardest to be upfront about the limitations, the nature of GraphQL makes it very difficult to handle every case, as each query is different!

In this case, I would recommend lowering the number of users you’re requesting at a time and submitting more individual requests - I was able to get the query to execute when asking for 5 users, for example.

If that doesn’t work, let me know and we can brainstorm more options!