jcrygier / graphql-jpa

JPA Implementation of GraphQL (builds on graphql-java)
MIT License
165 stars 46 forks source link

connection query without content is now possible #18

Closed manuel-mauky closed 7 years ago

manuel-mauky commented 7 years ago

Fix for #14 With this fix you can write a queries like:

{
    HumanConnection(paginationRequest: { page: 1, size: 2}) {
        totalPages
        totalElements
    }
}

This can be useful if you are only interested in the number of elements and pages but don't need any content.

The implementation uses the fact that in the criteria query a list of Predicate is created based on Field.getAttributes(). I'm passing an empty Field which results in an empty predicate list.