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

Add relay-style "Connections" to lists #32

Closed
mike-marcacci opened this issue Jun 1, 2019 · 1 comment
Closed

Add relay-style "Connections" to lists #32

mike-marcacci opened this issue Jun 1, 2019 · 1 comment

Comments

@mike-marcacci
Copy link
Member

mike-marcacci commented Jun 1, 2019

I had been hoping that we could get away with simple offset/limit pagination, particularly because all the extra objects can be a bit overwhelming to GraphQL newcomers... however, it appears that TCG may be interested in adopting GraphQL in places where this is not feasible, and cursor-based pagination will be necessary. The latter is a far superior way of addressing the problem, so if the learning is going to happen, we might as well begin enforcing this best practice here.

Because it is such a well-establiished convention, we will follow the semantics outlined in relay's connection spec. Until this RFC lands in GraphQL, it will be impractical to describe this as an interface, and we will instead have to just follow the naming scheme.

@mike-marcacci
Copy link
Member Author

This is a breaking change to the GraphQL API (which is fine, as this is still in beta). @lolosett @arnav-aggarwal @zepfan you may want to check out the relay connection specification which I'll be implementing anywhere there is a potentially large list returned.

It's a bit verbose (which is why I was hesitant to introduce it) but incredibly flexible. It essentially allows me to implement offset-based pagination now, then transparently switch to something more performant without any API changes.

mike-marcacci added a commit that referenced this issue Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant