Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.08 KB

readme.md

File metadata and controls

69 lines (53 loc) · 1.08 KB

wp-graphql-nexgi-extension

I develop headless wordpress blogs using nextjs & gatsby and use graphQL as flexible data fetching. For that I'm using wp-graphQL official plugin.

Dependiencies

Features

Total number of posts, pages count in graphQL wordpress

feature information

Added an options to get total number of posts, pages or any custome post type of wordpress using grpahQL. This originally given here . But here I coveted into wordpress graphQL plugin.

How to use it

Total number of pages

{
  pages{
    pageInfo{
      total
    }
  }
}

Response

{
  "data": {
    "pages": {
      "pageInfo": {
        "total": 14
      }
    }
  }
}

Total number of posts

{
  posts{
    pageInfo{
      total
    }
  }
}

Response

{
  "data": {
    "posts": {
      "pageInfo": {
        "total": 14
      }
    }
  }
}