A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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!
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
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!