Questions tagged [github-graphql]

Use for questions about the v4 GraphQL API of the GitHub software development platform.

Links:

148 questions
1
vote
1 answer

Does Github GraphQL return commit parents in a particular order?

According to the documentation (https://docs.github.com/en/graphql/reference/objects#commit), the parents function returns "the parents of a commit." Are these sorted the same way as in git? For example, if I merge branch B into branch A, will the…
Tim Seah
  • 11
  • 1
1
vote
1 answer

Query open pull requests in an organization created by members of a team?

Once a pull request is approved by any member of a requested team, it disappears from the GitHub dashboard, even if it lingers in an open state. How can we query using the Github v4 GraphQL the open pull requests created by any members of a…
SteveCoffman
  • 983
  • 1
  • 8
  • 22
1
vote
1 answer

Github GraphQL list repo permissions for a Team

I am really struggling to get anything sensible out of the GitHub GraphQL api... I want to get a list of repos and the permission levels for a team. So far I have Q= """query { organization(login: "MY_ORG") { team(slug:"MY_TEAM") { …
apr_1985
  • 1,764
  • 2
  • 14
  • 27
1
vote
1 answer

How can I pass multiple cursors to a single GitHub GraphQL query with multiple node ids?

I'm trying to batch my GraphQL queries to retrieve the data I need from multiple repositories with the same request, where each repository has a different cursor. Assuming I have the IDs of 3 nodes and only 2 cursors with the following…
Zomtorg
  • 153
  • 1
  • 11
1
vote
1 answer

GitHub GraphQL filter multi variable language filter

I'm trying to use GitHub's GraphQL API to find a list of repos matching a query but limited to a specific language. However, I can't find anything in the docs relating to the multi variable language filter the typical online search supports or how…
Mohamad reza1987
  • 193
  • 1
  • 7
  • 28
1
vote
1 answer

Github V4 graphql - Cant get organization user contribution info

I'm new to Github API v3 (rest) & v4 (graphql). I have created a PAT (personal access token) and using it to fetch data from github - organization private repositories. While able to get other users data (event, commits, issues etc.) in my…
AsafG
  • 136
  • 1
  • 9
1
vote
1 answer

Pattern matching in GitHub GraphQL query

I'm trying to query the branch protection rules which has the similar patterns using wildcards. Any suggestion are welcome. query { repository(owner:"user",name: "repo") { branchProtectionRules(first: 10) { nodes { pattern …
1
vote
0 answers

What's the best way to check if a repository object in GitHub's GraphQL Library uses GitHub Pages

I know that I can use the Deployments field of a GitHub GraphQL Repository object to check if the repository uses GitHub pages - but if a repository has multiple deployments strategies (if that's even possible?), one might have to paginate through…
Hugh Rawlinson
  • 979
  • 9
  • 29
1
vote
0 answers

Get repository contributors with Github Graph Api V4

Is it possible to get the contributors to a repository using GitHub's graphql api? I've been searching in the explorer and I can't find a contributor property or anything like that on the Repository node. However, it seems that given a user, the…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
1
vote
1 answer

Empty "node" objects being returned from graphql response

I have just started learning graphql and I created a query that returns a list of first 10 closed issues along with some attributes. To my surprise, the response objects in JSON that I get are sometimes empty and sometimes they are non empty. The…
1
vote
0 answers

Get branches first commit using github graphql

I'm trying to get all recent branches and their first commit details. I came up with this query : query ($owner: String!, $repo: String!, $after: String!) { repository(owner: $owner, name: $repo) { tags: refs(refPrefix: "refs/heads/", first:…
user2326167
  • 107
  • 1
  • 6
1
vote
1 answer

using graphql github api to get commit information by Id

I would like to get commit details for a specific commit given that I already have the commit id for example, if I know the commit id is 12762b76cba8ac4623a6c16e1fe60efafa3b7d1c and the repo is ruby/ruby how do I get the committedDate and author…
eiu165
  • 6,101
  • 10
  • 41
  • 59
1
vote
0 answers

Graphql get all commits between 2 tags

I want to list all the commits between 2 tags If i try to get commits between 2 dates on which tags point, i even get the commits from other branch which was merged after 2nd commit but made between those 2 dates. I will like to get some thing…
Parteek
  • 21
  • 1
1
vote
0 answers

GraphQL query commit history in range on 2 commits

I am trying to get list of all commits between 2 given cursors. I have tried to use before and after argument for history ref(qualifiedName: $branch) { target { ... on Commit { history(after:$firstCommit, before: $lastCommit) { …
Parteek
  • 21
  • 1
1
vote
0 answers

GitHub: Get a count of changed files in a repository for a date range

I am trying to get a count of files that have been changed for a given date range (monthly report). I am able to get a commit count pretty easily with GitHub's API V4. I modified that query to also get a count of changed files in each commit and I…
BrianH
  • 7,932
  • 10
  • 50
  • 71