nuwave / nuwave/lighthouse

Support pagination with unlimited results

Open
#2,734 3 comments 0 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?

I currently have a field where pagination is useful in many, but not all, cases. In some cases I'd like to be able to specify first: null or first: -1 and receive all results. My current workaround is to simply provide a large limit (e.g., 1000000), but doing so creates inefficient queries, particularly when accessing nested paginated records.

Which possible solutions should be considered?

It would be great to be able to make the first argument nullable, thus dropping all limit clauses for a field.

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 tracing how the GraphQL field's first argument is validated and how pagination limits are applied, including for nested paginated records. Compare the proposed first: null and first: -1 behaviors and determine the existing pagination tests to extend. Done means an explicitly unlimited request omits limit clauses without changing normal pagination.

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.