Allow us to query maximum limits


#1

It would be nice if we could query the API to get the maximum limits so we can optimize our software ontop the API dynamically. Lets say we do a query like:

query Stat($repo: String!, $user: String!,
$path: String!, $count: Int!) {
  rateLimit {
    cost
  }

  repository(owner: $user, name: $repo) {
    ref(qualifiedName: "refs/heads/master") {
      target {
      	... on Commit {
          id

          history(first: $count, path: $path) {
            pageInfo {
              hasNextPage
              hasPreviousPage
              startCursor
              endCursor
            }

            edges {
              node {
                id
                committedDate
                abbreviatedOid
                commitUrl
                oid

                committer {
                  user {
                    id
                    name
                    avatarUrl
                    login
                    url
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Right now we can assume $count Int! = 100 but if that ever changes then it would be nice if our software doesn’t need to change since we can pre-query the query to get a set of limit for specific queries.


#2

I think this is a great idea. I’ve added this to our internal issue tracker to discuss. Thanks @envygeeks! We’ll update you here when we have some more information to share.