Apollo-ios: Handling of Relay connections

Created on 18 Sep 2017  路  8Comments  路  Source: apollographql/apollo-ios

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.

enhancement

Most helpful comment

This is definitely something we should support, especially for larger queries.

All 8 comments

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:

  • Adding conformance to a Connection protocol to the generated types would give us a way to treat connections generically and add extension methods.
  • I'd also like to add support for the @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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiteshborse12 picture hiteshborse12  路  4Comments

Dmurph24 picture Dmurph24  路  4Comments

maxsz picture maxsz  路  4Comments

Robuske picture Robuske  路  3Comments

vishal-p picture vishal-p  路  4Comments