Extract pagination logic with fractal outside the query helper