question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How should we do pagination?

See original GitHub issue

Hi, Blake.

We have already talked about it a couple of times on Slack. I’m bringing here the topic. Are you doing pagination? How are you doing it?

I’ve been playing with pagination for a while. My implementation was based on Relay-style cursor pagination and written on ember-apollo-client v0.1.2. I’ve faced some problems with observable queries and their subscription, so I had to use this.get('apollo.client').watchQuery to handle observable queries and their subscriptions by hand. I’ve updated ember-apollo-client to v0.2.2 and now my implementation is broken due to some changes on Apollo Core - but I know what I need to change.

I see, now, that it’s time to stop putting my hands on Apollo Core and use more ApolloService. Because the things we need to handle on Ember are not straightforward. In exemple, since Apollo Core v0.8.0, query results are deep frozen, so we need to deep copy the query result to “defrost” it because Ember asks for an extensible object as a model. And ApolloService already handle this on query and queryOnce.

I have an exemple of my old implementation. It’s a little bit outdated since it’s not a production code, but it shows how I play with observable queries and their subscriptions.

I would love to see how do implement pagination. Are you relying on Apollo Core too? Do you think ember-apollo-client should mirror Apollo Core functions?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
DevanBcommented, Oct 31, 2017

This is fantastic to hear! I’m going to add it to the How to GraphQL tutorial now!

0reactions
viniciussbscommented, Apr 4, 2019

@viniciussbs How did you finally get around to implementing pagination? I am currently trying to get it to work with relay style cursor pagination but have run into the same issues as you.

I’m using the RouteQueryManager mixin. I haven’t started removing the mixins because there are some symbiotic mixins in the app I’m working on, but it would be great a new strategy without mixins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination Best Practices for Google | Documentation
Pagination : Where a user can use links such as "next", "previous", and page numbers to navigate between pages that display one page...
Read more >
The best database pagination technique is … | by Matej Bačo
Pagination is a strategy employed when querying any dataset that holds more than just a few hundred records. Thanks to pagination, we can...
Read more >
What is Pagination? And How to Implement it on Your Website
Pagination allows webmasters to present a lot of information in small and manageable chunks. E-commerce sites will show the product's image and ...
Read more >
Everything You Need to Know About API Pagination
Offset pagination is one of the simplest to implement. It's achieved using the limit and offset commands. Offset pagination is popular with apps ......
Read more >
How To Make a Pagination - W3Schools
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found