How to query with arguments to limit results


#1

I was wondering how to correctly construct a query limiting / filtering results by arguments. For instance: How would I query for the last 10 repos where isPrivate = false?

This is my starting point:

{
  viewer {
    repositories(last: 10) {
      edges {
        node {
          isPrivate
          id
          name
        }
      }
    }
  }
}

#2

We haven’t implemented any filtering arguments on the User repositories yet. But filtering by isPrivate would definitely be really useful. :thumbsup:

If we supported this, the syntax would probably look something like:

 {
  viewer {
    repositories(last: 10, isPrivate: true) {
      edges {
        node {
          isPrivate
          id
          name
        }
      }
    }
  }
}

#3

Just saw this got implemented. For the benefit of others:

 {
  viewer {
    repositories(last: 10, isFork: true, privacy: PRIVATE) {
      edges {
        node {
          isPrivate
          id
          name
        }
      }
    }
  }
}

#4