graphql / graphql-js

A reference implementation of GraphQL for JavaScript
http://graphql.org/graphql-js/
MIT License
19.97k stars 2k forks source link

author/committer -> user fields returning NULL for commits committed by user #4102

Closed ashish-stratgeek closed 1 month ago

ashish-stratgeek commented 1 month ago

I am using below graphql query to get all commits details on a given branch in repo. But in many cases it is returning user field in committer and author as NULL.

query {
    repository(owner: "%s", name: "%s") {
        ref(qualifiedName: "refs/heads/%s") {
            target {
                ... on Commit {
                    history(first: 100) {
                        pageInfo {
                            endCursor
                            hasNextPage
                        }
                        nodes {
                            oid
                            committedDate
                            author {
                                user {
                                    id
                                    login
                                }
                            }
                            committer {
                                user {
                                    id
                                    login
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Some of the cases I noticed:

  1. person had different username and email in local, compared to github
  2. a person was removed from organisation i.e. removed access for the repo.

In both cases, is it possible to get id or login of the committer?