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.

ShopifyQL Query Stopped Working, throwing a syntax error

ShopifyQL Query Stopped Working, throwing a syntax error

Herald_FF
Tourist
7 0 2

We had a working shopifyql query but it stopped working today and is throwing an error: Syntax not recognized

 

What could have happened? Was there a change with how queries are done cause they were working previously but now is not: 


below is our query:

graphQLquery ="""{ shopifyqlQuery(query: "from sales show net_quantity 
by product_title, hour 
since yesterday until today order by hour") 
{ __typename ... on TableResponse { tableData { rowData columns { name dataType displayName } } } parseErrors { code message range { start { line character } end { line character } } } } }"""

and here is the error:

Herald_FF_0-1665138417374.png

 

Reply 1 (1)

mikerowave
Shopify Staff (Retired)
22 3 2

Hi @Herald_FF!

 

The error is talking about the first part of the query, 

"from sales show net_quantity by product_title"

That "by" is out of place. You'll need to use GROUP BY or ORDER BY, and not just "by".

 

Take a look at how to use ShopifyQL in your queries in the dev docs for more info! 

Mike M (mikerowave) | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know!
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit shopify.dev or the Shopify Web Design and Development Blog