I have been using the GraphQL API successfully with a personal access token generated (based on these instructions) with specific permissions. When I try to run the same query with the secrets.GITHUB_TOKEN
value included by default in GitHub Actions workflows, it fails with a 502 error from the server. Included below are the relevant query and response.
I have tried:
- Reducing the number of edges/nodes to be returned from the request
- Trying other minimal queries that don’t require any special permissions
- Having the code wait for various timeout lengths and then retry the same query
It seems like requests using this token are limited to very few edges/nodes in the response, but the limit is not stated anywhere. I am wondering:
- Why is this happening?
- How can I prevent this from happening in the future?
- Why does the access token I have created succeed, but the default
GITHUB_TOKEN
fail?
Reference information:
Error response (click to expand)
{
"data": null,
"errors":[
{
"message":"Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `0701:1EF1:53DBBA:696A03:5FD5599B` when reporting this issue."
}
]
}
Original Problematic Query (click to expand)
{
viewer {
login,
name,
repositories(
first: 100,
orderBy: {
field: UPDATED_AT,
direction: DESC
},
isFork: false,
after: null
) {
pageInfo {
hasNextPage
endCursor
}
nodes {
nameWithOwner
stargazers {
totalCount
}
forkCount
languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
edges {
size
node {
name
color
}
}
}
}
}
repositoriesContributedTo(
first: 100,
includeUserRepositories: false,
orderBy: {
field: UPDATED_AT,
direction: DESC
},
contributionTypes: [
COMMIT,
PULL_REQUEST,
REPOSITORY,
PULL_REQUEST_REVIEW
]
after: null
) {
pageInfo {
hasNextPage
endCursor
}
nodes {
nameWithOwner
stargazers {
totalCount
}
forkCount
languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
edges {
size
node {
name
color
}
}
}
}
}
}
}