Skip to content

How to implement pagination #369

Discussion options

You must be logged in to vote

At Netflix we use the relay spec as well. I copied the following from an (internal) example, hopefully that helps a bit.
As you can see, we manually define the connection types in the schema, and use API in graphql-java to create the results in the datafetcher.

type Movie @key(fields: "movieId") @extends {
    movieId: Int! @external
    fakeReviews: FakeReviewConnection
}

type FakeReviewConnection {
    pageInfo: PageInfo!
    edges: [FakeReviewEdge]
}

type FakeReviewEdge {
    cursor: String!
    node: FakeReview
}

interface FakeReview {
    movie: Movie
    id: ID
    submittedBy: String
    postedDate: LocalDateTime
}
@DgsData(parentType = DgsConstants.MOVIE.TYPE_NAME, field = Dgs…

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by timpamungkas-bfi
Comment options

You must be logged in to vote
3 replies
@jandrade1
Comment options

@SquireOfSoftware
Comment options

@jandrade1
Comment options

Comment options

You must be logged in to vote
7 replies
@srinivasankavitha
Comment options

@ruxiao16
Comment options

@jandrade1
Comment options

@srinivasankavitha
Comment options

@ruxiao16
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants