Skip to content
Discussion options

You must be logged in to vote

Commits

Alternative way to get commits with GraphQL API

# get the user ID
{
  user(login: "hyochan") {
    id
  }
}

# result
{
  "data": {
    "user": {
      "id": "MDQ6VXNlcjI3NDYxNDYw"
    }
  }
}
# get the commits from a given repo for the user  ID
{
  repository(owner: "hyochan", name: "react-native-masonry-list") {
    defaultBranchRef {
      name
      target {
        ... on Commit {
          history(first: 10, author: {id: "MDQ6VXNlcjI3NDYxNDYw"}) {
            nodes {
              author {
                user {
                  login
                }
              }
              committedDate
              abbreviatedOid
              message
            }
          }
 …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hyochan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions related to GitHub's APIs or Webhooks New To GitHub 👋 New To GitHub Product Feedback Share your thoughts and suggestions on GitHub features and improvements
3 participants