younifyd
Menu

site_categoryTree

The category tree, optionally starting from a given category.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the site_categoryTree action (under Category).
  3. Fill in the fields below, then reference the result from later steps as {{siteCategorytree.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 SiteCategoryTree($rootEntityId: Int) {
  site {
    categoryTree(rootEntityId: $rootEntityId) {
      entityId
      name
      path
      description
      productCount
      image {
        altText
        isDefault
      }
      hasChildren
    }
  }
}

Variables

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

rootEntityIdnumber

A root category ID to be used to load the tree starting from a particular branch. If not supplied, starts at the top of the tree.

json
{
  "rootEntityId": 0
}

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