App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi everyone,
I’m building a Shopify app and want to use ShopifyQL for analytics data. I’m familiar with running Shopify GraphQL queries (using Insomnia), but I’m unsure how to properly query ShopifyQL through the API.
Specifically, I’d like to know:
Here’s an example of a ShopifyQL query I’d like to run for sales over time
query {
shopifyqlQuery(query: "FROM sales SHOW total_sales BY day SINCE -30d") {
results {
data
}
}
}
I’d appreciate any insights or examples!
Thanks in advance!
Does this way is possible ?
I have a same question like yours but couldnt find any relevant source.
Same problem I am having right now. We just want to get the monthly totals for the Gross Sales, Discounts, and Returns.
Currently we have to use the Admin API to fetch individual Order data, then aggregate the numbers from there.
It feels like doing order-based fetching is a waste of resources on Shopify's end (and the API consumer) since we only need the totals. In the Admin Analytics UI, you can query using ShopifyQL, but from searching I don't think this is possible using the Admin GraphQL API.