younifyd
Menu

site_route

Resolve a URL path to the catalog or content object it points at (product, category, brand, page, blog post) or its redirect.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the site_route action (under Route).
  3. Fill in the fields below, then reference the result from later steps as {{siteRoute.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 SiteRoute($path: String!, $redirectBehavior: RouteRedirectBehavior!) {
  site {
    route(path: $path, redirectBehavior: $redirectBehavior) {
      node {
        id
      }
      redirect {
        id
        fromPath
        to {
          __typename
        }
        toUrl
      }
    }
  }
}

Variables

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

pathstringrequired

An url path to an expected entity.

redirectBehaviorstringrequired

The flag that allows you to specify the desired behavior when encountering a redirect for the requested route.

One ofFOLLOWIGNORE

json
{
  "path": "string",
  "redirectBehavior": "FOLLOW"
}

Response

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

nodeobject
idstring
redirectobject
idstring
fromPathstring
toobject4 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

toUrlstring

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

site_route — BigCommerce Storefront — Documentation