When using PageHelper.nextPage() (code here), the final page isn't handled correctly. Internally, the helper fails to mutate its state if the after cursor is undefined. This means nextPage() endlessly repeats querying and returning the final page rather than indicating that there are no more pages left.