Additional Setup to Use shopifyqlQuery?

Topic summary

Core issue: Calling the shopifyqlQuery GraphQL operation returned “Bad Request” when using the unstable Admin API, despite other unstable cURL examples working. The app already had the read_reports scope, and the query was copied directly from the Shopify docs.

Confirmation: Another developer reported experiencing the same error.

Most recent resolution: The problem was likely due to the API version. Switching from the unstable endpoint to a stable or newer version (2023-04 or higher) resolved the issue:

  • Use: https://{shop}.myshopify.com/admin/api/2023-04/graphql.json (or newer)
  • Context: At the time of the original post, the feature may have been in beta on unstable.

Outcome: No extra setup beyond correct API versioning was required; read_reports scope was sufficient. The issue appears resolved by updating the API version.

Status: Resolved; no remaining open questions noted. Code example from docs was central to reproducing the error.

Summarized with AI on January 22. AI used: gpt-5.

Curious if there is something I need to do to activate the capability to run the shopifyqlQuery function. I’m successfully running other cURL request examples from the documentation using the unstable version of the GraphQL API no problem but when I try and drop in this function I get a ‘Bad Request’ response. My personal app has read_reports scope.

-d '{
"query": "{ shopifyqlQuery(query: "from sales show total_sales by month since -1y until today") { __typename ... on TableResponse { tableData { rowData columns { name dataType displayName } } } parseErrors { code message range { start { line character } end { line character } } } } }"
}'

This example is lifted directly from the docs here: https://shopify.dev/api/admin-graphql/unstable/queries/shopifyqlQuery#examples-Get_a_table_data_response_by_using_ShopifyQL_query

Hey, I am receiving the same thing. Were you able to resolve?

It is an old question, but just in case it is useful here my answer. I believe your issue was related to the version of the API used. Try using this one or higher: ‘2023-04’

https://${SHOP}.myshopify.com/admin/api/2023-04/graphql.json

At the time of writing this question, there was probably a beta version of the api(?)