Querying total number of repositories excluding forks


#1

Is there a way to query the total number of repositories of the user by excluding the forked one.

{
  user(login: "akshaybabloo"){
    repositories(isFork: true){
     totalCount
    }
  }
}

Gives only the forked one and if I remove isFork: true then the total number includes the forked repositories.


#2

Hey @akshaybabloo,

You can use isFork: false to filter out the forks. Is that what you’re looking for?


#3

Hi @d12,

That doesn’t seem to work. I get the same number with or without isFlag. And as far as I understand isn’t isFlag set to false by default?

Update

It looks like I have to use affiliations: [OWNER] isFork: false then I get the correct answer.


#4

Glad you got it sorted! Give us a shout if you come across any other problems :smile: