hasNextPage wrong when using before greather than last resource


#1

When I execute the following query in the GraphQL Explorer, where cursor is greather than last repository cursor, shows last repository and keep saying:
hasNextPage: true

which is not true I’m seeing last repository so there is no nextPage remaining

{
  user(login: "gaearon") {
    id
    login
    name
    repositories(
      last: 5,
      before: "Y3Vyc29yOnYyOpKod29ya3Nob3DOA5Krtb=="
      orderBy:{
        field: NAME,
        direction: ASC
      }
    ) {
      totalCount
      pageInfo {
        hasNextPage
        hasPreviousPage
      }
      edges {
        cursor
        node {
      		id
          name
          url
          createdAt
        }
      }
    }
  }
}

In a personal project I solved this situation like this:

if (this.pagination.last) {
  if (startCursorDecoded) {
    this.hasPages.previous = !(await this._isFirstDocument(startCursorDecoded));
  }

  if (this.pagination.before &&
  this.pagination.before !== '' &&
  endCursorDecoded) {
    this.hasPages.next = !(await this._isLastDocument(endCursorDecoded));
  }
}

Same logic when retrieving first n elements with after