Questions tagged [github-api-v4]
41 questions
9
votes
2 answers
GraphQL query based on a specific value of a field
I want to be able to retrieve the latest release from GitHub for a specific repo using their GraphQL API. To do that, I need to get the latest release where isDraft and isPrerelease are false. I have managed to get the first part, but cant figure…

Raj Rao
- 8,872
- 12
- 69
- 83
4
votes
2 answers
Deleting stale checks on github
I have ended up with some stale checks, mostly as outcome of renaming/refactoring workflows, and I'd like to remove the stale ones, but github doesn't seem to expose any button/api.
How can I do that? Stale checks also prevent developers from…

Hitmands
- 13,491
- 4
- 34
- 69
4
votes
1 answer
How to search specific page through GitHub API V4
Github APIv4 GraphQL has some good features but I cant find a way to search issues using pagination like
https://api.github.com/search/issues?q=repo:user/somerepo+is:open&page=10&per_page=100
Is there a way to solve it? Thanks!

injoker1
- 163
- 10
4
votes
1 answer
Github personal access token for accessing private repository's: /repos/:user/:repo/contents
I am trying to use a personal access token for accessing the contents of a repository.
If the repository is public I can achieve this both with v3 and with v4 api. Both of the requests below return the contents:
v3:
curl…

Marinos An
- 9,481
- 6
- 63
- 96
4
votes
1 answer
Can you use raw graphQL syntax to query github API v4 in c# using octokit.net library?
I am trying to use graphQL to query repositories and their content, but can't figure out how to build a desired query in LinQ. Is there any way I could execute raw GraphQL query avoiding the LinQ syntax?
My functional GraphQL query looks like this:…

Jiří Melen
- 147
- 8
3
votes
0 answers
List all commits before a given commit with Github GraphQL API v4
I'm trying to list all commit on a branch between the latest commit and a given commit.
It seems that the history(before) is not working as intended. The query below gives me the first 100 commit on that branch without respecting the before cursor I…

caithagoras
- 31
- 1
3
votes
1 answer
How to get the zipballUrl of a branch using github graphQL API?
I am trying to programmatically download a zip file of a repository which is already checked out to a specific branch.
For that I need to obtain the zipballUrl of the head of the branch I specify through github graphQL API.
This answer specifies…

tharinduwijewardane
- 2,593
- 2
- 16
- 28
3
votes
2 answers
Pull Request Review Comment wrong position from the diff?
I have a webhook that listen to all code reviews, then I fetch the comments of this PR review in order to get the position of the comment in the diff.
I'm using the GitHub REST API, but the issue I have is the same with the GraphQL API.
So the…

Kmaschta
- 2,369
- 1
- 18
- 36
2
votes
1 answer
Github Graphql API create repo
I am using below query to create repo:
gh api -i graphql -f query='
mutation {
createRepository(input: {name: "gh-create-test", visibility: PRIVATE, ownerId: "ID"}) {
repository {
url
}
}
}
'
THe repo gets created…

Stack_IQ
- 438
- 5
- 20
2
votes
1 answer
How to get raw content directly from api.github.com (or raw.githubusercontent.com)
First of all, please take note of the new API changes:
https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/
The problem seems to be that I have to exchange a github personal access token for a temporary token, in…

KC Johnson
- 41
- 1
- 8
2
votes
0 answers
Can I use GitHub GraphQL API to search the path of a file in a specific repository?
For example, for the file 'a.txt', I want to know the path of this file in the repo B. How should I do?

Sunflowers
- 67
- 8
2
votes
1 answer
How can I access github repository contents using graphql (v4 api)?
If I use github v3 api to access the directory contents of a public repository using the following query:
curl https://api.github.com/repos/w3c/webappsec/contents/
what is the equivalent in graphql?
I can get for example the description of the…

Marinos An
- 9,481
- 6
- 63
- 96
2
votes
2 answers
GraphQL API Protected branch
I am using a GITHUB API V3 in one of my projects now we are migrating to GraraphQL API V4. I want to list all the branches of the repo and I want to check whether it is a protected branch. In GITHUB API V3 it has a branches API that will list all…

Parithiban
- 1,656
- 11
- 16
1
vote
2 answers
Retrieve ALL Github issues of a specific Project using the GraphQL API
I've been trying to retrieve all GitHub issues of a specific project using their GraphQL API.
The problem that i have is that i need to specify in the items a first or last param it doesn't work. Although by specifying one of these params i get only…

PixelTheory
- 11
- 2
1
vote
1 answer
Github GraphQL API Get all commits of a User
I'm trying to use the GitHub GraphQL API to get all the additions made by a user (additions can be found from their commits). I've been able to get the additions from pull requests, but I haven't found a way to do the same for commits. How can I get…

Jacob
- 1,577
- 8
- 24