Skip to content

Connection cursor before and last return wrong result #7

Closed
@choeisai

Description

@choeisai

I use graphql-compose-connection for my project to make pagination with cursor base.
It worked when I use 'after' and 'first'. But if I used 'before' and 'last', it return wrong expected result.

Case 1
after: "cursor-5", first: 3
result: [r-6, r-7, r-8]

r-0
r-1
r-2
r-3
r-4
r-5 <- cursor
r-6 <- expected result
r-7 <- expected result
r-8 <- expected result
r-9
r-10

Case 2
before: "cursor-5", last: 3
result: []

r-0
r-1
r-2 <- expected result
r-3 <- expected result
r-4 <- expected result
r-5 <- cursor
r-6
r-7
r-8
r-9
r-10

In my opinion, case 2 should return [r-2, r-3, r-4] but it return [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions