-
Notifications
You must be signed in to change notification settings - Fork 97
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
Pagination and generics #529
Comments
What is needed for support? Does Porpaginas need to implement an interface? What causes it to not support generics? |
@oojacoboo This is causing issues for us as well (for Laravel paginator, not Porpaginas). Laravel itself doesn't support generics everywhere, but Right now Generic types are just regular What I propose (keeping the backwards compat) is the following flow for generic types, in order:
Don't know on the implementation yet. Thoughts? |
I haven't used the pagination implementation yet, so I'm not familiar with it. That said, I think we need to support an interface implementation and not a pagination lib directly. There was an open PR on Porpaginas recently preventing compatibility with PHP8: beberlei/porpaginas#23. That was recently merged and tests are passing on 2.0 now. That's been merged into As for generics support. I do think we should support that. @oprypkhantc what's an example of a non-list pagination type? |
@oojacoboo Well any pagination type isn't a list, technically. It's an object with one of the fields being list. Other generic types, in the context of GraphQL, may include any kind of wrappers. Speaking of pagination, for GraphQL's cursor pagination spec we'll likely need generic "Connection" and a generic "Edge", both of which aren't iterables/lists as well. |
Yea, if we can add a check for |
Hello,
This issue is just to open a discussion.
I would like to write my paginated query like this :
instead of :
It will better match with generic support in other tools in general (phpstan, psalm, phpstorm etc...) but the down stream (Porpaginas) does not actually support generics
Note : Support for generic already exist (#468)
The text was updated successfully, but these errors were encountered: