Skip to content

Support pagination with unlimited results #2734

Open

Description

@williamjallen

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.

Activity

  1. spawnia commented on Jan 5, 2026

    @spawnia
    Collaborator

    Sounds reasonable. I am not planning on developing this feature myself, but might look into it for a sponsoring or if a pull request is proposed.

  2. williamjallen commented on Jan 5, 2026

    @williamjallen
    Author

    I'll see what I can do to implement this.

  3. elitexp commented on Jan 19, 2026

    @elitexp

    I do have this in Older Lighthouse in my fork of this lighthouse but I preferred formats like
    users(first:-1)
    {
    total
    hasMorePages
    data{
    name
    }
    }

    Also has support of
    users(first:0) {
    total
    }
    as PaginatedModels Loader fires the count query (required) and the fetch query (wasted).
    So, will need to re-work so that others don't get broken :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA feature or improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions