Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Shopify GraphQL Python 3 Starter w/ Pagination

Shopify GraphQL Python 3 Starter w/ Pagination

Hisham
Tourist
6 0 1

Since I had to implement this to pull data into our custom BI system I thought I'd share it with the community as well in case someone else was interested or had to do something similar.

 

The script fetches orders from a Shopify store (via private app access token) using the GraphQL API.

 

It supports pagination by following cursors.

 

Uses Docker to run if you don't want to install Python 3 + required dependencies.

 

GitHub repo:

https://github.com/mardambey/shopify-python-graphql-pagination

 

Hope this helps! 

 

Replies 2 (2)

Ganehs
Visitor
2 0 0

Hi,

Pagination implementation provides great help for me in building an app which export products from the platform. Is it possible to merge products and collections in a single query which yields collections in an array under the products?

 

Let me know if this is possible.

 

Thanks,

Ganesh

Hisham
Tourist
6 0 1

Hi,

I suggest that you read the documentation to see if you can craft a query that does what you want. You can test in the Shopify Admin API GraphiQL explorer and then modify the code.

The current query is here:

https://github.com/mardambey/shopify-python-graphql-pagination/blob/master/app.py#L31

You'll have to modify that once you have the appropriate query that loads what you need.

Hope that helps!