nuwave / nuwave/lighthouse

Paginator return type is not applied to interface definition

Open
#1,695 6 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
When creating an interface with a paginated field, the resulting schema definition is not transformed to an XPaginator.

Expected behavior/Solution
The interface field should be transformed as well.

How to reproduce

interface Entity {
  field: [Return] @paginate
}
type EntityA {
  field: [Return] @paginate
}

Generated schema:

interface Entity {
  field: [Return]
}
type EntityA {
  field: ReturnPaginator
}

Lighthouse Version v4.18.0
(Is it possible this is fixed in v5? can't migrate yet)

Related: #936

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 reproducing the issue with the minimal GraphQL schema in the report: an interface and implementing type with a paginated field using @paginate. Compare the generated interface and object definitions; done means the interface field is transformed to the corresponding paginator type just as the object field is.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.