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

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

                      }
                    }
                  }
                }
              }

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

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 !

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

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

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

                  }
                }
              }
            }
          }

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

@Theresa
could you answer me please

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 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

Internal Reference: Log in with Atlassian account

HI @tomasw

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

@tomasw Any updates mr tomas ?

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

1 Like