Hey.
It will be really good if the client has a way to handle connections. As far I understand it, if I want to render an infinite scroll table view that is fed via a connection, I have to handle this completely in my code. I'm uncertain how that interacts with the cache (I assume it doesn't). It feels like a generic enough case to deserve some support in the client.
I've asked @martijnwalraven about this in the GraphQL Slack's #swift channel and he suggested I open an issue. I'd be happy to attempt a pull request (and figure out the code), but I certainly need some architectural guidelines on how the API should look and behave. @martijnwalraven also mentioned that this would be a good place to discuss how this change should look.
Would love to see this added. This is core to scrolling list views.
For pagination support in general, I'd like to stay as close as possible to Apollo JS, because something like fetchMore doesn't tie us to Relay connections specifically.
There are a few things I think we can do to make dealing with those more convenient however, both in the generated code and in the runtime:
Connection protocol to the generated types would give us a way to treat connections generically and add extension methods.@connection directive that both Relay and Apollo JS support to generate a stable caching key that ignores pagination parameters.This functionality would be extremely useful 馃檶
Any news about this topic?
Is there any way to implement the pagination functionality?
Any news about this topic?
This is definitely something we should support, especially for larger queries.
Throwing this link on here as a note to self and for anyone curious about what this is all about: https://blog.apollographql.com/understanding-pagination-rest-graphql-and-relay-b10f835549e7
This might also solve the problem for watching paginated queries
https://spectrum.chat/apollo/apollo-ios/pagination-watchquery~3e3a3a93-cb84-4962-8573-7d683a09f1d4
https://blog.apollographql.com/pagination-and-infinite-scrolling-in-apollo-client-59ff064aac61
Most helpful comment
This is definitely something we should support, especially for larger queries.