christophstrobl / graphql-pagination

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started

mvn spring-boot:run
open http://localhost:8080/graphiql

Requests

Single Book by id

query bookDetails {
    bookById(id: "book-001") {
        id
        title
        publicationDate
        author {
            firstName
            lastName
        }
    }
}

List all Books

query bookDetails {
    allBooks {
        id
        title
        publicationDate
        author {
            firstName
            lastName
        }
    }
}

Page through all Books

query bookDetails {
    allBooksPaged(page: 0, size: 5) {
        id
        title
        publicationDate
        author {
            firstName
            lastName
        }
    }
}

Scroll through all Books

query bookDetails {
    allBooksWindowed(cursor: "") {
        edges {
            node {
                id
                title
                publicationDate
                author {
                    firstName
                    lastName
                }
            }
        }
        pageInfo {
            endCursor
            hasNextPage
        }
    }
}

About


Languages

Language:Java 100.0%