GraphQL API - get changed file name by commited repository

Hello again,

Thanks for helping me before, I still need help for some issue, I want to get all changed files in one commit.

what i have done is like this : 

query {
  repository(owner: "wojtekmaj" name:"react-date-picker"){
    object(oid:"50e933af2f28ca8da451c63afcced8dca467f2c7"){
      ... on Commit{
        oid
        changedFiles,
        tree{
          entries{
            name
          }
        }
      }
    }
  }
}

response : 

{
  "data": {
    "repository": {
      "object": {
        "oid": "50e933af2f28ca8da451c63afcced8dca467f2c7",
        "changedFiles": 3,
        "tree": {
          "entries": [
            {
              "name": ".babelrc"
            },
            {
              "name": ".codeclimate.yml"
            },
            {
              "name": ".eslintignore"
            },
            {
              "name": ".eslintrc.json"
            },
            {
              "name": ".gitattributes"
            },
            {
              "name": ".gitignore"
            },
            {
              "name": ".travis.yml"
            },
            {
              "name": "LICENSE"
            },
            {
              "name": "README.md"
            },
            {
              "name": "copy-styles.js"
            },
            {
              "name": "copy-types.js"
            },
            {
              "name": "entry.nostyle.d.ts"
            },
            {
              "name": "index.d.ts"
            },
            {
              "name": "jest.setup.js"
            },
            {
              "name": "package.json"
            },
            {
              "name": "sample"
            },
            {
              "name": "src"
            },
            {
              "name": "test"
            },
            {
              "name": "yarn.lock"
            }
          ]
        }
      }
    }
  }
}

the query works well, but I wanna filter the tree file by changed file only by current commit, I just want to get 3 files changed as the property  “changedFiles”: 3 told me,

any advice would be appreciated,

thank you

1 Like

Any update on this?

Hi, have you finally found solution? I am looking for the same answer