younifyd
Menu

shopifyqlQuery

Executes a ShopifyQL query to analyze store data and returns results in a tabular format. The response includes column metadata with names, data types, and display names, along with the actual data rows.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the shopifyqlQuery action (under Shopifyql).
  3. Fill in the fields below, then reference the result from later steps as {{shopifyqlquery.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query ShopifyqlQuery($query: String!) {
  shopifyqlQuery(query: $query) {
    parseErrors
    tableData {
      columns {
        columnOrigin
        dataType
        displayName
        dynamicColumnMetadata
        name
        shortDisplayName
        subType
      }
      rowMetadata {
        nullCellTranslations
        rawResourceIds
        topNRemainderColumnNames
      }
      rows
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

querystringrequired

A ShopifyQL query string following the [ShopifyQL syntax](https://shopify.dev/docs/api/shopifyql). Queries must include `FROM` to specify the data source (such as `sales`, `orders`, or `customers`) and `SHOW` to select metrics and dimensions. Example: `FROM sales SHOW total_sales TIMESERIES month SINCE -12m`.

json
{
  "query": "string"
}

Response

Read the result with {{shopifyqlquery.response.data.data.shopifyqlQuery}}. If the API returns errors, the step fails and they are at {{shopifyqlquery.response.data.errors}}.

parseErrorsarray<string>
tableDataobject
columnsarray<object>
rowMetadataarray<object>
rowsstring

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

shopifyqlQuery — Shopify — Documentation