nuwave / nuwave/lighthouse

Add support for bidirectional cursor pagination

Open
#1,188 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

What problem does this feature proposal attempt to solve?
The current form of cursor pagination provides first and after fields. This is great for unidirectional pagination, but it doesn't provide a way of moving backwards in bi-directional pagination.

Which possible solutions should be considered?

We really just need to extend the cursor pagination to accept last and before arguments. It already provides the startCursor in the pageInfoResolver.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the existing cursor pagination implementation and its pageInfoResolver, which currently supports first and after and exposes startCursor. Trace how pagination arguments and page information are handled before extending the behavior. Done means cursor pagination supports last and before for backward navigation while preserving the existing forward-pagination behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, laravel, php
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.