New pagination on API version 2019-07

New Member
1 0 0

I wonder how stupid the pagination process is. Instead of getting an information of the previous or next page in the response context for easier serialization and manipulation, we have to search a header context and parsing strings. I did a bunch of integrations, but I didn't see anything like this.
I think that this example is most useful:

{
    "orders": [
        {
            "id"123456890123,
            "email""test@example.com",
            "closed_at""2019-09-07T16:36:35+12:00",
            "created_at""2019-09-06T01:20:29+12:00",
            "updated_at""2019-09-07T16:36:35+12:00",
            ...
            ...
            ...
            ...
        }
    ],
    "errors""",
    "page_next""eyJkaXJl1ZSI6IjI1bW0gQWlyIEludGFrZSBIb3NlIn0",
    "page_previous""eyMCwibGFzdI6IjI0bW0gRXhoYXVzdCBTaWxlbmNlciJ9"
}

 

0 Likes
Shopify Partner
156 4 13

I can't understand what they're doing! at least they should think about different programming language. Its very hard to parse link data. It can create bug in APPS.   

0 Likes
Shopify Staff
Shopify Staff
5 0 0

If it's helpful, here's an example of how the shopify_api gem parses the Link headers: https://github.com/Shopify/shopify_api/blob/51984e873bc40027a68e8fbd1e6442db1f10038a/lib/shopify_api...

0 Likes