502 querying for User's hasAnyContributions (in contributionsCollections)

I am performing a search on User in the v4 GraphQL API, and adding 

contributionsCollection {
hasAnyContributions
}

breaks it. I get a 502 response with this body:  

“Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include 80B2:02B9:312B273:3AB84F6:5D85453F when reporting this issue.” 
Removing that clause allows the search to succeed.

Here is the entire query:

query {
search(first: 100, type:USER, query:"language:python location:usa") {
    pageInfo {
      startCursor
      hasNextPage
      endCursor
    }
    userCount
    nodes {
        ... on User {
        bio
        company
        contributionsCollection {
          hasAnyContributions
        }
        email
        id
        isBountyHunter
        isCampusExpert
        isDeveloperProgramMember
        isEmployee
        isHireable
        isSiteAdmin
        isViewer
        location
        login
        name
        url
        websiteUrl
      }
    }
  }
}

Hi @lmatter,

Thanks for being here,  I believe this is both a bug, but also it looks like it’s being triggered by a time out in the amount of data that you are requesting. All API calls have a 10 second limit, and if executing this takes longer - the call is terminated and an error is returned.

Single GraphQL requests can involve more data per request then REST calls, and are more expensive 1:1 in general (however they are far more optimized).

For now, you’ll need to reduce the amount of data the query involves, perhaps reducing the pagination from 100 objects per page, I was able to run the query at 20. I’ll pass it along this feedback to the appropriate teams. 

1 Like

Great, thanks!  I’ll try that.