[Laravel] GraphQL Cursor Pagination not working
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- api, backend-api-design
Research direction
Start by comparing the Laravel implementation's simplePaginate handling with Laravel's cursorPaginate function, and review the related issue #8033. Done means GraphQL $after and related arguments use cursor pagination, cursors are serialized and deserialized, and affected GraphQL operations are treated as partial pagination.
Written by the indexing model from the issue text.
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:
- It is not really a cursor based pagination (see this issue)
- It does not seem to be accounted at all (at least not in the laravel implementation) - this might be due to how laravel
simplePaginateworks (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.
- Dominant language
- PHP
- Stars
- 2.6k
- Forks
- 989
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 100
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from api-platform/core
-
JSON:API: resource schemas (`*.jsonapi`) have `properties` but no `type: object`Possibly taken @ousamabenyounes claimed this 2 days ago. Open
Difficulty 2/5 Under an hour Newbie friendliness 80/100
api-platform/core#8701 ·
Maintainers usually reply within 1 day
-
JSON:API: `JsonApiCollectionBaseSchemaNoPagination` declares `data` as `type: array` without `items`Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api-platform/core#8699 ·
Maintainers usually reply within 1 day
-
[Json-Schema] Nested resources lost externalDoc and description dataPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
api-platform/core#8721 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
api-platform/core#8704 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
api-platform/core#8703 ·
Maintainers usually reply within 1 day
All issues in api-platform/core
Similar issues
-
domain/discovery
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
neos/flow-development-collection#3639 · 1 comment ·
Maintainers usually reply within 1 day
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3Possibly taken @ekamran claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WordPress/phpunit-test-runner#359 ·
Maintainers usually reply within 2 days
-
ObjectMapper
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
symfony/symfony-docs#23390 ·
Maintainers usually reply within 2 days