# Getting error when request to get before start cursor (pagination)

**URL:** <https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630>\
**Category:** GraphQL API\
**Created:** [October 10, 2021, 4:08pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630 "2021-10-10T16:08:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 10, 2021, 4:08pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/1 "2021-10-10T16:08:47Z")

</div>

hello i’m trying to get the previous orders page data with this request but i’m getting error  
how to get the previous data with pagination, thanks

```
                    query {
                orders {
                  request_id
                  complexity
                  data(before:"YXJyYXljb25uZWN0aW9uOjEw") {
                    pageInfo {
                      hasNextPage
                      hasPreviousPage
                      startCursor
                      endCursor
                    }
                    edges {
                      node {
                        id
                        order_number
                        fulfillment_status

                        shipping_address{
                          first_name
                          last_name
                          city
                          address1
                          phone
                          email
                        }

                        total_price
                        ready_to_ship
                        required_ship_date

                        shipping_lines {
                          carrier
                          method
                        }

                        shop_name

                      }
                    }
                  }
                }
              }
```

---

<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:** [October 12, 2021, 7:55pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/2 "2021-10-12T19:55:43Z")

</div>

Hi @karimedrees,  
Please post a request-id and we can look into it further. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 16, 2021, 7:51pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/3 "2021-10-16T19:51:37Z")

</div>

Hi @Theresa the request id is 616b2ceb6e33619f222338e9  
please note that when i change

data( **before** :“YXJyYXljb25uZWN0aW9uOjEw”) to data( **after** :“YXJyYXljb25uZWN0aW9uOjEw”) it works

but i need to get the previous page data how can i accomplish that, thanks !

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 17, 2021, 6:05pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/4 "2021-10-17T18:05:20Z")

</div>

I need a solution as soon as possible please, the web app is in production now!  
@Theresa  
thanks

---

<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:** [October 19, 2021, 4:44pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/5 "2021-10-19T16:44:55Z")

</div>

Hi @karimedrees  
Apologies for the delay. For testing, can you give me some of the data associated with the array connection?

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 27, 2021, 4:25am UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/6 "2021-10-27T04:25:31Z")

</div>

Hi @Theresa Sorry for late reply  
which data you need the query or the response ?  
this is the query and i got error response whenever i try to access **before** data

```
                query {
            orders {
              request_id
              complexity
              data( **before** :"YXJyYXljb25uZWN0aW9uOjEw") {
                pageInfo {
                  hasNextPage
                  hasPreviousPage
                  startCursor
                  endCursor
                }
                edges {
                  node {
                    id
                    order_number
                    fulfillment_status

                    shipping_address{
                      first_name
                      last_name
                      city
                      address1
                      phone
                      email
                    }

                    total_price
                    ready_to_ship
                    required_ship_date

                    shipping_lines {
                      carrier
                      method
                    }

                    shop_name

                  }
                }
              }
            }
          }
```

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 27, 2021, 4:26am UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/7 "2021-10-27T04:26:38Z")

</div>

i want the before data in order to make the user able to go to the previous page in pagination

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [October 31, 2021, 2:04am UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/8 "2021-10-31T02:04:38Z")

</div>

@Theresa  
could you answer me please

---

<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:** [November 1, 2021, 10:35pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/9 "2021-11-01T22:35:10Z")

</div>

Hi @karimedrees

Thanks for reaching out!  
Could be because that cursor is not “unique”

Multiple cursors that start with `YXJyYXljb25uZWN0aW9uOjEw`  
YXJyYXljb25uZWN0aW9uOjEwMQ==  
YXJyYXljb25uZWN0aW9uOjEwMg==

Which are all [base64](https://www.base64decode.org/) for `arrayconnection:10....`

We just made an engineering ticket about this and will let you know as soon as we are able to figure out why this could be happening.

Thanks in advance!  
Tom

---

<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:** [November 1, 2021, 10:35pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/10 "2021-11-01T22:35:43Z")

</div>

Internal Reference: [Log in with Atlassian account](https://shiphero.atlassian.net/browse/CUS-1370)

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [November 5, 2021, 8:20am UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/11 "2021-11-05T08:20:54Z")

</div>

HI @tomasw

Thanks A lot, waiting for your updates as soon as possible.

---

<div class="post-metadata">

**Author:** ![karimedrees](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karimedrees](https://community.shiphero.com/u/karimedrees)\
**Post date:** [November 8, 2021, 11:15am UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/12 "2021-11-08T11:15:45Z")

</div>

@tomasw Any updates mr tomas ?

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [November 8, 2021, 6:54pm UTC](https://community.shiphero.com/t/getting-error-when-request-to-get-before-start-cursor-pagination/1630/13 "2021-11-08T18:54:15Z")

</div>

Hello @karimedrees!  
Our engineers are still looking into it.  
In the meantime, I would suggest you use the before and after parameters, paired with the last and first parameters respectively.  
This means calling the API with `data(before:string last:int)` or `data(after:string first:int)`.  
This way you gain control over the number of values returned. It might not seem a problem now, but once you get to the thousands of orders, you might be spending all your credits in just one query, as it will try to query everything that comes before that cursor.  
Please let me know if this helps.  
Thank you in advance!  
Tomas
