Skip to content

Prisma 2 pagination. Small help needed :-).  #883

Closed

Description

@SvitlanaShepitsena

Dear pro,
First of all, I am so sorry if I am asking to the wrong channel. I had a pretty big Prisma 1, react, apollo, nextjs app with relay-type pagination. It took me a while but I finally switched to Prisma 2. First of all, I like very much error handling and code-first approach and also switched to typescript :-).

My question that I already have a relay-type pagination with entityConnections - HOWEVER my website is not facebook, so there is no need in cursor pagination. My questions are:

type PaginatedPosts {
nodes: [Post!]!
meta: PaginationMeta!
}

type PaginationMeta {
nodeCount: Int!
pageCount: Int!
pageCurrent: Int!
nodesPerPage: Int!
}

I would appreciate at least very brief answers with direction and I will continue my research and will figure out details, but I did not find it in documentation, so I would like to get a direction from developers.

P.S. FINALLY, THANK YOU GUYS - YOU REALLY MADE MY DEV LIFE MUCH, MUCH EASIER. Writting resolvers was real torture for me - I was thinking that some of my friends switched to WordPress and they are millioners, some switched to Jumla and they make 400k, some work in Angular and are pretty reach and I always kepts going to the right but hard path and now in order to have a simple form - I need to spend 4 hours.

Jesus, why I did not switch to WordPress - maybe I should throw everything and there is this new hot thing WIX.... however, PRISMA changed everything. It's a game-changer, THANK YOU FOR YOUR HARD WORK!

Activity

  1. pantharshit00 commented on Nov 8, 2019

    @pantharshit00
    Contributor

    Hi @SvitlanaShepitsena

    Thanks for the kind words 🙌

    Right now we provide properties from which you can implement both cursor or offset based pagination:
    image

    So using before or after you can implement cursor-based pagination and using first or last and skip you can implement offset based pagination.

    Right now we don't include any pagination metadata which you are expecting but we might implement something like that in the coming weeks as it is in the current spec of photonjs here: https://github.com/prisma/specs/tree/master/photonjs#experimental-meta-response

  2. SvitlanaShepitsena commented on Nov 9, 2019

    @SvitlanaShepitsena
    Author

    Thank you !

  3. SvitlanaShepitsena commented on Nov 9, 2019

    @SvitlanaShepitsena
    Author

    Thank you, pantharshit00. Looking forward for PageInfo meta-data.... I will try to implement in myself, though I will have to do it for each type but in my case it's so many. And if you have generic implementations then I can easily switch.

    If you implement metadata and do not forget let me know please as I am eagerly waiting for:-)! THANK YOU GUYS!

  4. added
    kind/feature
    and removed on Nov 11, 2019
  5. marcjulian commented on Jan 15, 2020

    @marcjulian
    Contributor

    Are you still planing on implementing pagination metadata?

  6. janpio commented on Jan 15, 2020

    @janpio
    Contributor

    Best create a new issue @marcjulian to get this properly looked into and answered.

  7. marcjulian commented on Jan 16, 2020

    @marcjulian
    Contributor

    @janpio I have create a new issue #1343

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions