Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 3

502 querying for User's hasAnyContributions (in contributionsCollections)

Solved! Go to Solution.

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
      }
    }
  }
}
2 Replies
Solution
Community Manager
Message 2 of 3

Re: 502 querying for User's hasAnyContributions (in contributionsCollections)

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. 


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 3
Message 3 of 3

Re: 502 querying for User's hasAnyContributions (in contributionsCollections)

Great, thanks!  I'll try that.