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 with graphql.js #514

Closed
NetOperatorWibby opened this Issue Feb 19, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@NetOperatorWibby

NetOperatorWibby commented Feb 19, 2018

This would be extremely useful information to have. Every post on the Internet thus far regarding implementing pagination in GraphQL requires the use of something that is not graphql.js. Is that particular section going to be added at some point?

@nikolasburk

This comment has been minimized.

Contributor

nikolasburk commented Mar 1, 2018

Hey @NetOperatorWibby, thanks a lot for opening this issues!

Every post on the Internet thus far regarding implementing pagination in GraphQL requires the use of something that is not graphql.js.

What exactly do you mean with that? Pagination has to be implemented in a way that the server interacts with the database, so it will always interact with something that is not graphql.js (a database). In the graphql-js tutorial, Prisma provides the data access layer as an abstraction over your database. This allows to implement pagination in a straightforward manner in the GraphQL server itself.

Is that particular section going to be added at some point?

It is not planned to add a particular section for pagination at the moment - however, I would love to hear your suggestions what exactly you would expect there :)

Thanks! Let me know if you have any further questions 🙌

@nikolasburk nikolasburk closed this Mar 1, 2018

@NetOperatorWibby

This comment has been minimized.

NetOperatorWibby commented Mar 1, 2018

Maybe I should've been more clear.

When you look at the "Hands-on tutorials" section on the homepage, these tutorials have sections on pagination:

  • Angular + Apollo
  • Vue + Apollo
  • React + Relay
  • React + Apollo
  • graphql-ruby
  • graphql-java
  • graphql-python

I would love to hear your suggestions what exactly you would expect there :)

My initial request was for the graphql.js tutorial to have a pagination section. The last three tutorials I listed are in the same backend section as the graphql.js tutorial so it doesn't seem like this would be an insurmountable thing to include.

@nikolasburk

This comment has been minimized.

Contributor

nikolasburk commented Mar 1, 2018

Ah I see :) The graphql-js tutorial doesn't have a dedicated section on pagination because the implementation is trivial when using Prisma, so there's no need to have a dedicated section on it.
The API that is built still includes pagination though, so if you're interested in learning how to implemented pagination graphql.js, you can just walk through the tutorial 👍
Does that make sense? 🙂

@NetOperatorWibby

This comment has been minimized.

NetOperatorWibby commented Mar 1, 2018

No, it doesn't, and that's unfortunate for those who don't want to add yet another system into their project. Regardless of how trivial you may think the implementation is, it is not so for those coming to GraphQL as a newbie who wants to integrate GraphQL into their process with minimal fuss.

It sounds like there's zero interest in adding this trivial section. I'm sure someone on the Internet will create a tutorial at some point but it doesn't make sense to me that the official "how to learn GraphQL" site is devoid of this information.

There should at least be a passing reference to what you just told me. I don't recall reading/hearing anything about Prisma when I went through that section a few weeks ago.

@nikolasburk

This comment has been minimized.

Contributor

nikolasburk commented Mar 1, 2018

Regardless of how trivial you may think the implementation is, it is not so for those coming to GraphQL as a newbie who wants to integrate GraphQL into their process with minimal fuss.

That's a great point, sorry about that! The tutorial should be geared towards newcomers, so you're absolutely right that it should become clear to them how pagination works with GraphQL.

There should at least be a passing reference to what you just told me. I don't recall reading/hearing anything about Prisma when I went through that section a few weeks ago.

The tutorial has only been updated ~1 month ago to use Prisma, so this be the explanation why you haven't seen it before!

In any case, I appreciate that feedback very much! I'm currently planning quite a major update to the graphql-js tutorial anyways (hopefully I'll get to it in the next ~2 weeks) and will make sure there's an explicit section about pagination then!

@nikolasburk

This comment has been minimized.

Contributor

nikolasburk commented Apr 4, 2018

Hey @NetOperatorWibby 🙌

I finally got around updating the Node tutorial. There now is an entire section on Pagination in the Filtering, Pagination & Sorting chapter. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment