# GraphQL count total number of orders

**URL:** <https://community.shiphero.com/t/graphql-count-total-number-of-orders/1249>\
**Category:** GraphQL API\
**Created:** [April 12, 2021, 7:57am UTC](https://community.shiphero.com/t/graphql-count-total-number-of-orders/1249 "2021-04-12T07:57:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikram](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@vikram](https://community.shiphero.com/u/vikram)\
**Post date:** [April 12, 2021, 7:57am UTC](https://community.shiphero.com/t/graphql-count-total-number-of-orders/1249/1 "2021-04-12T07:57:24Z")

</div>

I am using the orders query to fetch orders. How is it possible to count the total number of orders I have. I am using this query  
query {  
orders(warehouse\_id: “V2FyZWhvdXNlOjExNzkw”) {  
request\_id  
complexity  
data(first: 10) {  
edges {  
node {  
id  
legacy\_id  
order\_number  
partner\_order\_id  
shop\_name  
fulfillment\_status  
order\_date  
total\_tax  
subtotal  
total\_discounts  
total\_price  
auto\_print\_return\_label  
custom\_invoice\_url  
account\_id  
email  
profile  
packing\_note  
required\_ship\_date  
flagged  
saturday\_delivery  
ignore\_address\_validation\_errors  
priority\_flag  
source  
third\_party\_shipper {  
zip  
account\_number  
country  
}

```
      gift_invoice
      order_history {
        created_at
        information
        user_id
      }
      allow_partial
      require_signature
      adult_signature_required
      alcohol
      expected_weight_in_oz
      insurance
      insurance_amount
      currency
      has_dry_ice
      allocation_priority
      allow_split
      line_items(first: 10) {
        edges {
          node {
            sku
            quantity
            quantity_allocated
            quantity_pending_fulfillment
            backorder_quantity
            promotion_discount
          }
        }
      }
    }
  }
}

```

}  
}

Now this, for example, displays the first 10 order details. But my aim is to find the total count of all the orders (number of current months, years orders) Thanks in advance.

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [April 13, 2021, 12:12am UTC](https://community.shiphero.com/t/graphql-count-total-number-of-orders/1249/2 "2021-04-13T00:12:31Z")

</div>

Hi @vikram!  
You won’t be able to know that number beforehand, for that you will need to iterate over the results using [Pagination](https://developer.shiphero.com/graphql-primer/#pagination)

```
data {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }

```

Until there is `hasNextPage:false` for the criteria you are using to filter.  
Please let us know if there is anything else we could help with.  
Thanks in advance!  
Tom

---

<div class="post-metadata">

**Author:** ![kevchcm](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@kevchcm](https://community.shiphero.com/u/kevchcm)\
**Post date:** [March 3, 2026, 9:52pm UTC](https://community.shiphero.com/t/graphql-count-total-number-of-orders/1249/3 "2026-03-03T21:52:35Z")

</div>

Why can you have a **total\_count** field as you have for shipments?
