title: Max number of results from GraphQL
body: <p>I am working on a project with GraphQL-java and Hibernate with MariaDB.
  In my current solution, I get 18938 results back. I just want to see the last 10 of these. So I am looking for a solution to limit the number of results. </p>
  
  <p>On the internet I see examples of limiting the number of results (<a href="https://graphql.org/learn/pagination/" rel="nofollow noreferrer">https://graphql.org/learn/pagination/</a>). They call it pagination. However, I cannot find the server implementation of this. Does anyone have experience with this? </p>
  
  <p>I have an Entity class, with some properties : <strong>Test.java</strong></p>
  
  <pre><code>
  @Entity
  @Table(name = "test")
  public class Test {
  
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
  
    @NotNull
    @Size(max = 64)
    @Column(nullable = false)
    private String name;
  
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "parent")
    private Test parent;
  
  
    public Test() {
    }
  
    public Long getId() {
      return id;
    }
  
    public void setId(Long id) {
      this.id = id;
    }
  
    public String getName() {
      return name;
    }
  
    public void setName(String name) {
      this.name = name;
    }
  
  
    public Test getParent() {
      return parent;
    }
  
    public void setParent(Test parent) {
      this.parent = parent;
    }
  
  
  </code></pre>
  
  <p>My repository class: <strong>TestRepository.java</strong></p>
  
  <pre><code>public interface TestRepository extends CrudRepository&lt;Test, Integer&gt; {} 
  </code></pre>
  
  <p>My GraphQL resolver class: <strong>Query.java</strong></p>
  
  <pre><code>@Component
  public class Query implements GraphQLQueryResolver {
    private TestRepository testRepository;
  
    @Autowired
    public Query(TestRepository testRepository) {
      this.testRepository = testRepository;
    }
  
    public Iterable&lt;Test&gt; findAllTests(Integer first) {
      return testRepository.findAll();
    }
  
    public long countTests() {
      return testRepository.count();
    }
  }
  </code></pre>
  
  <p>My GraphQL schema:  <strong>test.graphqls</strong></p>
  
  <pre><code>type Test {
    id: ID!
    name: String!
    parent: Test
  }
  
  #extend query
   type Query {
   findAllTests(first: Int): [Test]!
    countTests: Int!
  }
  
  </code></pre>