# Packs\_per\_day query not reporting correct data for the date filter

**URL:** <https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441>\
**Category:** GraphQL API\
**Created:** [July 16, 2021, 4:59am UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441 "2021-07-16T04:59:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [July 16, 2021, 4:59am UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/1 "2021-07-16T04:59:33Z")

</div>

Hi,

We want to run a query every 15 minutes to check on the recent packs and ensure items were all scanned.  
But looking at the response of packs\_per\_day with date\_from and date\_to filter, it is returning results 5 hours and 51 minutes ahead.

Below is the query with the date range filter.

```auto
query {
    packs_per_day(date_from: "2021-05-26T14:30:03" date_to: "2021-05-26T14:30:04") {
            request_id
            complexity
            data {
            pageInfo {
            hasNextPage
            hasPreviousPage
            startCursor
            endCursor
        }
        edges {
            node {
                    id
                    shipment_id
                    warehouse_id
                    total_items
                    unique_items
                    barcodes_scanned
                    user_first_name
                    user_last_name
                    created_at
                    order {
                        id
                        order_number
                    }
                }
            cursor
            }
        }
    }
}

```

This query returned result with created\_at: “2021-05-26T20:21:03”.

request\_id: “60f008f1bba32db49eb08add”

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [July 16, 2021, 6:33pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/2 "2021-07-16T18:33:00Z")

</div>

Hi,  
I just did the same query,

```auto
query {
  packs_per_day(
    date_from: "2021-07-16T12:00:03"
    date_to: "2021-07-16T14:00:00"
  ) {
    request_id
    complexity
    data {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      edges {
        node {
          id
          shipment_id
          warehouse_id
          total_items
          unique_items
          barcodes_scanned
          user_first_name
          user_last_name
          created_at
          order {
            id
            order_number
          }
        }
        cursor
      }
    }
  }
}

```

and the results included “order\_number”: “002183194” which seems to be spot-on for the results. I am not too sure why May is giving you problems, and it would be very difficult to go back that far. Do you have a recent example of the same issue?

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [July 17, 2021, 8:21am UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/3 "2021-07-17T08:21:29Z")

</div>

Hi Theresa,

Below is the recent example with request\_id,  
which is also returning results 5 hours and 51 minutes ahead.

```auto
query {
  packs_per_day(
    date_from: "2021-07-16T12:00:00"
    date_to: "2021-07-16T12:01:00"
  ) {
    request_id
    complexity
    data {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      edges {
        node {
          id
          shipment_id
          warehouse_id
          total_items
          unique_items
          barcodes_scanned
          user_first_name
          user_last_name
          created_at
          order {
            id
            order_number
          }
        }
        cursor
      }
    }
  }
}

```

This query returned result with created\_at: “2021-07-16T17:51:48”  
request\_id: “60f28e6e3268dd09e92befb1”

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [July 19, 2021, 10:38am UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/4 "2021-07-19T10:38:18Z")

</div>

For Packs and Picks per day API:

the inconsistency of user details in the **response** of Shiphero API, there are some user’s data that will be available in the API response, but the same user information itself is not present on the Shiphero platform screen. The same happens vice versa, user packer logs are not present in API response while it’s available on the screen.

for example,

- if you check the logs from API response for April 6th and July 8th: Tekita Williams, this user is not available on the ShipHero screen but API fetched picker logs for him/her.
- 27-5-2021 12:38 pm CST in screen, Nate Reynolds packer log not available in Shiphero API response.

the above is only what we have caught, but there may exist more such inconsistencies.

Please have a look at it.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [July 23, 2021, 5:40pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/5 "2021-07-23T17:40:57Z")

</div>

I will send the 5 hour difference that packs\_per\_day is returning over to engineering. Thank you for the very direct example!

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [July 29, 2021, 1:26pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/7 "2021-07-29T13:26:43Z")

</div>

Hi Theresa,

Any update on this?

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [July 29, 2021, 5:07pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/8 "2021-07-29T17:07:41Z")

</div>

It is still in the queue. I will see if I can get it prioritized. Thank you for the heads up!

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [August 3, 2021, 2:15pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/9 "2021-08-03T14:15:27Z")

</div>

Hi @supritha we are working on getting in, we will keep you up to date as it progresses. Right now, it is still in queue

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [August 16, 2021, 10:12am UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/10 "2021-08-16T10:12:49Z")

</div>

Hi, @Theresa any update on the above request.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [August 16, 2021, 4:05pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/11 "2021-08-16T16:05:41Z")

</div>

Hi @supritha  
I just checked and it should have some review in the next few days.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 13, 2021, 2:31pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/12 "2021-09-13T14:31:47Z")

</div>

This is showing as complete from engineering. @supritha

---

<div class="post-metadata">

**Author:** ![askthebird](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@askthebird](https://community.shiphero.com/u/askthebird)\
**Post date:** [September 14, 2021, 7:28pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/13 "2021-09-14T19:28:36Z")

</div>

@Theresa  
I’m now seeing something similar to the original issue.

If I run @supritha’s original query with dates of `2021-09-14T14:00:00.000Z` through `2021-09-14T19:00:00.000Z`. I get 13 results, so a little over 400 missing. Our peoples’ reviews & bonuses depend on this API. Those date strings are 8601-compliant.

The request\_id for that was `6140f6de17f3bdf17b489512`

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 14, 2021, 7:39pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/14 "2021-09-14T19:39:34Z")

</div>

Thank you, I will check this out

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [September 17, 2021, 1:57pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/15 "2021-09-17T13:57:52Z")

</div>

Hi Theresa,

We tried to get the result using the below-mentioned query. But it is returning results 5 hours ahead. It seems like we need to pass CST to get the result in UTC.

Which timezone do we need to pass in the query ( UTC or CST)?

Query:

> query {  
> packs\_per\_day(date\_from: “2021-09-10T13:54:00” date\_to: “2021-09-10T13:54:56”) {  
> request\_id  
> complexity  
> data {  
> pageInfo {  
> hasNextPage  
> hasPreviousPage  
> startCursor  
> endCursor  
> }  
> edges {  
> node {  
> id  
> shipment\_id  
> warehouse\_id  
> total\_items  
> unique\_items  
> barcodes\_scanned  
> user\_first\_name  
> user\_last\_name  
> created\_at  
> order {  
> id  
> order\_number  
> }  
> }  
> cursor  
> }  
> }  
> }  
> }

Please find the request-id for that.

> ```
> "request_id": "61449b6d5c1f619f9668a89f",
> 
> ```

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 17, 2021, 9:23pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/16 "2021-09-17T21:23:33Z")

</div>

Hi @supritha  
Thank you for the request-id. I will look into this further

---

<div class="post-metadata">

**Author:** ![askthebird](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@askthebird](https://community.shiphero.com/u/askthebird)\
**Post date:** [September 27, 2021, 2:01pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/17 "2021-09-27T14:01:04Z")

</div>

Hi Theresa,

We are at 13 days where our warehouse kpi/bonus system has been shut down due to being unable to retrieve accurate results from `packs_per_day` queries with date filters.

Can you provide any update on this? As it stands now, I don’t even know if this has been triaged. Can you confirm that the returns from this query are indeed unexpected/inaccurate?

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 27, 2021, 10:10pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/18 "2021-09-27T22:10:50Z")

</div>

Hi @askthebird, I just ran the same query on your account and got the first 100. This is the result of request-id 6140f6de17f3bdf17b489512. The only thing that I did differently was to add the dates of the variables instead of variables. Could it be there was some type of error in the variables? This is what I ran.

```auto
query {
  packs_per_day(
    date_from: "2021-09-14T14:00:00.000Z"
    date_to: "2021-09-14T19:00:00.000Z"
  ) {
    request_id
    complexity
    data(first: 100) {
      pageInfo {
        hasNextPage
        endCursor
      }
      edges {
        node {
          id
          created_at
          user_id
          user_first_name
          user_last_name
          order_id
          order_number
          barcodes_scanned
          total_items
          unique_items
          order {
            order_date
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![askthebird](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@askthebird](https://community.shiphero.com/u/askthebird)\
**Post date:** [September 29, 2021, 7:51pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/19 "2021-09-29T19:51:39Z")

</div>

Hi @Theresa  
That example query you provided does indeed return results for me now. In fact, all of my time-filtered queries seem to return results as expected some hours after the time windows have passed.

If I query more recent data, the results are almost always empty.  
Example:

```auto
query {
    packs_per_day(date_from: "2021-09-29T18:59:59.999Z", date_to: "2021-09-29T19:30:00.000Z") {
        request_id
        complexity
        data(first:100) {
            pageInfo {
                hasNextPage
                endCursor
            }
            edges {
                node {
                    id
                    created_at
                    user_id
                    user_first_name
                    user_last_name
                    order_id
                    order_number
                    barcodes_scanned
                    total_items
                    unique_items
                    order {
                        order_date
                    }
                }
            }
        }
    }
}

```

Result:

```auto
{
  "data": {
    "packs_per_day": {
      "request_id": "6154c1767a5c91ecc16fb285",
      "complexity": 101,
      "data": {
        "pageInfo": {
          "hasNextPage": false,
          "endCursor": null
        },
        "edges": []
      }
    }
  }
}

```

That time window is meant to represent fulfillment creations between 13:59:59 and 14:30:00 US Central time. During this time window, a significant amount of bulk & regular shipping was being performed.

If I omit the UTC/zulu specification and convert it to local (Central) time, I get the results I expected. Has something changed with your datetime requirements? This format (JS Date.toISOString) had previously been in use for many months without issue.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 29, 2021, 9:13pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/20 "2021-09-29T21:13:54Z")

</div>

Thank you for the details. There may very well be something that needs attention or has been changed. I have a few posts where the time is sometimes returning unexpected results.

---

<div class="post-metadata">

**Author:** ![askthebird](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@askthebird](https://community.shiphero.com/u/askthebird)\
**Post date:** [September 30, 2021, 2:59pm UTC](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441/21 "2021-09-30T14:59:45Z")

</div>

I am going to switch to using account-local time for now. I’d prefer being able to specify TZ since that eliminates ambiguity on both ends.

In this case, requests that differ only in the presentation of TZ should return identical results.

[Next page](https://community.shiphero.com/t/packs-per-day-query-not-reporting-correct-data-for-the-date-filter/1441.md?page=2)
