graphqlgithub-graphql

See the size of the specific document in a specific branch of a repository


I want to determine the size of the file "foo" in the master branch of johndoe's "boo" repository.

Any suggestion?

I am using https://docs.github.com/en/graphql/overview/explorer to make the query.


Solution

  • This query can be used to determine the size of a given document located in a branch of a repository that belongs to another person.

    {
      user(login:"userName"){
        repository(name:"boo") {
          object(expression: "master:foo") {
            ... on Blob {
              byteSize
            }
          }
        }
      }
    }