Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Laravel] GraphQL Cursor Pagination not working

Open
#6,747 2 comments 1 reaction 0 assignees View on GitHub

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
Tech stack
graphql, laravel, php

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:

  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.

Dominant language
PHP
Stars
2.6k
Forks
989
Avg merge
1d 22h
Merged PRs (30d)
100

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/core

All issues in api-platform/core

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.