nuwave / nuwave/lighthouse

No documentation on how to add pagination type

Open
#2,274 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

There is no way to integration a custom pagination type. You can add a custom resolver to add custom builder instance but cannot add a new pagination type. This is useful features as there are 1) multiple ways to do pagination 2) external factors that my required a custom or modified pagination type such as DB design, system architecture, etc.

Expected behavior/Solution

A way to integration a custom pagination type. I have added one by altering the source pagination files but that is not ideal. I believe requiring it to be an extension of a LengthAwarePagination type to be fair since it would only require adding the new type as an available type type and being able to call it as a method available on the builder.

Steps to reproduce

  1. Look at the documentation
  2. There is documentation on how to add a resolver but that does not return the pagination, only a pre modified Builder instance

Output/Logs

N/A

Lighthouse Version

v5.70.0

I have done this manually by modifying the following src/Pagniation files:

  • PaginationType
  • PaginationServiceProvider
  • PaginationArgs

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 reading the existing resolver documentation and the src/Pagniation files named in the issue: PaginationType, PaginationServiceProvider, and PaginationArgs. Compare the documented custom-resolver path with the reporter’s manual changes. Done means a supported way to integrate a custom pagination type and document how to invoke it through the builder.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, laravel, php
Domain
api, backend-api-design
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.