Cover image of Pagination in naufalHaidar12342 !

Pagination in naufalHaidar12342 !

Reference.

Since this was a breakthrough for me, I feel obligated to give you the reference right away. Shout out to Mr. Hamed Bahram explaining it in one of his videos Pagination in Server Components | NextJs 13

The how.

Every time the next or previous button being clicked, it sends request to Hygraph API to fetch/grab the post contents with the specified needs, i.e. post title, post slug, etc. For each page, I only shows 6 posts to avoid fatigue in reading and/or scrolling the website.

You might notice between those two buttons, there is button that shows on which page the user currently on. Along with sending request to Hygraph, those two buttons also sends search query to naufalHaidar12342, which will be captured and processed to show the page number and content limit of each page.

Ok, how I did it, exactly?

You can check my repository, specifically through this link Pagination feature in naufalHaidar12342