Skip to content

[Laravel] GraphQL Cursor Pagination not working #6747

@toitzi

Description

@toitzi

API Platform version(s) affected: 4.0.4
Cursor Pagination with $after, etc... using graphql seems to not work in Laravel.
I think there are 2 Issues with it:

  1. It is not really a cursor based pagination (see this issue)
  2. It does not seem to be accounted at all (at least not in the laravel implementation) - this might be due to how laravel simplePaginate works (assuming that cursor based pagination is considered "partial" pagination, which it isn't automatically) and that there is no offset option for that.

A potential fix could be using laravels cursorPaginate function, but some serialization and deserialization of the cursor would need to be also added for this to work. Also GraphQL operations making use of that, should automatically be considered partial paginations.

I will try to open a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions