api-platform / api-platform/core
[Laravel] GraphQL Cursor Pagination not working
- Dominant language
- PHP
- Stars
- 2.6k
- Forks
- 980
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 48
Description
**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](https://github.com/api-platform/core/issues/8033) 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.
Contributor guide
Assessment
This issue has not been assessed yet.