Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add optional PageInfo support to t.list #132

Open
mxstbr opened this issue Jan 25, 2024 · 0 comments
Open

RFC: Add optional PageInfo support to t.list #132

mxstbr opened this issue Jan 25, 2024 · 0 comments
Labels
RFC A discussion about a future feature

Comments

@mxstbr
Copy link
Member

mxstbr commented Jan 25, 2024

Summary

I have a list of items that is paginated with pages. Using t.connection with edgeNullable: false (which I want because the edges can't be nullable and it simplifies the client code) requires me to return cursor on every edge—which doesn't make a lot of sense for page-based pagination.

While t.list doesn't require me to return a cursor and is the better fit for this use case, with t.list I can't add the same PageInfo type that t.connection uses to return pagination information ( especially hasNextPage and hasPreviousPage)

Proposed Solution

t.list({
  pageInfo: true,
  // → Adds the PageInfo type to the schema if no `t.connection` has already added it
  // → Requires returning `pageInfo` from `resolve`
})
@mxstbr mxstbr added the RFC A discussion about a future feature label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC A discussion about a future feature
Projects
None yet
Development

No branches or pull requests

1 participant