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

Pagination with graphql.js #514

Closed
NetOpWibby opened this issue Feb 19, 2018 · 6 comments
Closed

Pagination with graphql.js #514

NetOpWibby opened this issue Feb 19, 2018 · 6 comments

Comments

@NetOpWibby
Copy link

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
Copy link
Contributor

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 🙌

@NetOpWibby
Copy link
Author

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
Copy link
Contributor

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? 🙂

@NetOpWibby
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants