How to return changed files under Commit?


Is it possible to get changed files under Commit. I would like to get change files’ names and status(e.g. ‘modified’)?
It appears that tree{entities{names in Commits returns all files, and not only those that have been changed, and from one commit to the next the entries do not change.
Here is an example of a query:

query {
         repository(owner: "xyz", name: "abc") {
            ... on Repository{
                  ... on Commit{

Per commit, the equivalent endpoint in REST is this:
curl -i '' -u me
The returned json contains files collection. Is there a way to get to this data from the GraphQL query? In my case the rest query returns 4 changed files, as expected, but GraphQL returns all files, regardless of their status(even those that have not been modified)
Thank you


Hi there

+1, this is also of interest to me.

Actually I’m not sure how you get all files in the repository @nickrally – I can only figure out how to get the root tree, i.e. the trees correspond to files & directories in the root directory of the repo. There doesn’t seem to be a way to expand directory trees.

In any case, the ability to get the files changed by individual commits in v4 would be great. The same applies to PRs :slight_smile:

Thank you


This feature would be nice for me, too. files and stats, like we can do in v3.

Schema request to fetch a list of changed files associated with a pull request

Following up here with the same interest. I haven’t found a way to do this on Github’s graphql API directly, but - if you’re using Apollo - you can specify this in the client using directives (e.g., @include). See this post: and jump down to the Directives section.

Let me know if you guys have figured out how to do this on Github’s API directly.


I would really like this feature as well. List of new/modified/deleted files for a commit. Currently have to make one request per commit using v3 only for this, and I can do everything else in v4.



This is in the works! I can’t give an exact date, modeling git data can be challenging in GraphQL and we’re working on making the implementation as intuitive and complete as possible.

When this does eventually ship, we’ll let everyone know here.