Skip to content

Wrong algorithm for pageInfo.hasPreviousPage and pageInfo.hasNextPage? #54

Closed
@Hybrid-Force

Description

@Hybrid-Force

Thanks for the amazing library, first of all!

Please correct me if I am wrong, it seems that the algorithm for pageInfo.hasPreviousPage and pageInfo.hasNextPage fields are not following with the cursor connections spec.

pageInfo.hasPreviousPage = (!!args.last || !args.first) && (skip > 0 || !!args.after);
pageInfo.hasNextPage = (!!args.first || !args.last) && hasExtraRecords;

With current implementation, in forward pagination situation with first/after, pageInfo.hasPreviousPage is always set to false. And pageInfo.hasNextPage always false in backward pagination. In forward pagination, pageInfo.hasNextPage is only working with first and last both set, which is discouraged.

I am wondering if this deviation from the spec is intentional or is it a potential bug?

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