# How to page blog content

**URL:** <https://discourse.getcockpit.com/t/how-to-page-blog-content/1206>\
**Category:** Support\
**Created:** [February 10, 2020, 6:59am UTC](https://discourse.getcockpit.com/t/how-to-page-blog-content/1206 "2020-02-10T06:59:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jonah/32/466_2.png) [@jonah](https://discourse.getcockpit.com/u/jonah)\
**Post date:** [February 10, 2020, 6:59am UTC](https://discourse.getcockpit.com/t/how-to-page-blog-content/1206/1 "2020-02-10T06:59:57Z")

</div>

Does anyone have a code example where they use graphQL and are able to page their blogs (or any other collection)  
I would need a response from the api with the number of total blogs along with the range of blog posts requested.  
I have looked everywhere for this, but could not find any info. I cannot be the only one wanting this?

Cheers!

---

<div class="post-metadata">

**Author:** ![serjoscha87](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/serjoscha87/32/151_2.png) [@serjoscha87](https://discourse.getcockpit.com/u/serjoscha87)\
**Post date:** [February 10, 2020, 12:57pm UTC](https://discourse.getcockpit.com/t/how-to-page-blog-content/1206/2 "2020-02-10T12:57:43Z")

</div>

this is for mysql but should work the same with graphql I guess (becuase the data source should not be relevant):

> **[How to create Pagination with PHP and MySql - My Programming Tutorials](https://www.myprogrammingtutorials.com/create-pagination-with-php-and-mysql.html)**
>
> A step by step guide to create pagination in php and mysql. Paging allow you to display all your fetched results in multiple pages instead of showing them all in one place.

at least it describes how to manually create a pagination

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jonah/32/466_2.png) [@jonah](https://discourse.getcockpit.com/u/jonah)\
**Post date:** [February 10, 2020, 1:22pm UTC](https://discourse.getcockpit.com/t/how-to-page-blog-content/1206/3 "2020-02-10T13:22:33Z")

</div>

Thank you, but this will not work.  
I need to be able to query the graphQL direct via a rest call.  
I would like the response to be in JSON with an array of blogposts and the total number of availabe posts.

So, my call would be something like:  
MY\_WEBPAGE/api/collections/get/posts?token=MY\_TOKEN  
and the body would be something like  
{  
postsCollection {limit: NUMBER\_OF\_BLOGS\_PER\_PAGE, skip:STARTING\_POINT, feature\_image {path meta} date title content gallery {path meta}}  
}

with a response also containing the max number of available blog posts, lets say 28, I would know whether or not to show a next or previous button.
