A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi!
I'm working on an embedded application that needs to get the count of orders from a certain timerange. I think the graphql way with pagination is a hurdle and difficult to set up, plus it requires me to manually write the querying logic and aggregating the number of orders into a number. How can I query to get a count of all the orders while avoiding graphql request?
Correct me if I'm wrong (and how to do this if possible) I don't think querying the /admin..orders.json endpoint is feasible since this is an embedded application (publicly listed) and I will not have access to the apikey or apiSecret of the stores this application will integrate with.
Thank you.
Solved! Go to the solution
This is an accepted solution.
Okay, turns out I figured it out.
You can use the koa middleware (nodejs) to get the accessToken after proper O-auth. Then you can send the accessToken as part of the GET request in the header.
hello,
please use this api link from shopify it will count all orders please use filter which orders you are counting.
/admin/api/2020-07/orders/count.json
Thanks
hello,
can you please tell me what kind of orders you want to count. i will send you one script here you just need to run it on BASH.
then i will explain you in detail that code.
Thanks
I see everywhere to make the api calls like such: https://{yourapikey}:{yourapikey}@s{yourstore}/admin/orders.json
If I don't have the apikeys for the store (since it will be a public app), then this request cannot be made.
Does that make sense?
This is an accepted solution.
Okay, turns out I figured it out.
You can use the koa middleware (nodejs) to get the accessToken after proper O-auth. Then you can send the accessToken as part of the GET request in the header.