search api is limited to only the first 1000 items?

Is the search api really limited to only the first 1000 issues? I’m missing any reasons why that limitation should be there, as we are using proper pagination.

query search($query: String!, $first: Int!, $after: String) {
  search(query: $query, type: ISSUE, first: $first, after: $after) {
    issueCount

    pageInfo {
      hasNextPage
      endCursor
    }

    nodes {
      ... on Issue {
        number
        createdAt
      }
      ... on PullRequest {
        number
        createdAt
      }
    }
  }
}

The following variables return issue 1000 of facebook/react, try to adjust the page to the next page, or request more items by adjusting first, and the query will stop returning results:

{
  "query": "repo:facebook/react sort:created-asc",
  "first": 1,
  "after": "Y3Vyc29yOjk5OQ=="
}

Current response, no hasNextPage while there are 15841 issues, and this is only number 1000?

{
  "data": {
    "search": {
      "issueCount": 15841,
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Y3Vyc29yOjEwMDA="
      },
      "nodes": [
        {
          "number": 1000,
          "createdAt": "2014-01-30T23:39:12Z"
        }
      ]
    }
  }
}

The search API is for searching for a small subset of things within a large set of things. Your variables are emulating essentially “listing the entire set of issues and pull requests in a repo”. If that is your goal, then listing the entire set of issues directly is the recommended way of doing it:

query {
  repository(owner: "facebook", name: "react") {
    issues(first: 100, after: null) {
      totalCount

      pageInfo {
        hasNextPage
        endCursor
      }

      nodes {
        number
        createdAt
      }
    }

    pullRequests(first: 100, after: null) {
      totalCount

      pageInfo {
        hasNextPage
        endCursor
      }

      nodes {
        number
        createdAt
      }
    }
  }
}

Using this, you should be able to paginate all the way through the entire list.

I hope that helps!