younifyd
Menu

urlRedirects

Returns a paginated list of UrlRedirect objects configured for the shop. Each redirect maps an old path to a target location.

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the urlRedirects action (under Url).
  3. Fill in the fields below, then reference the result from later steps as {{urlredirects.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 UrlRedirects($first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $query: String) {
  urlRedirects(
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
    query: $query
  ) {
    edges {
      cursor
      node {
        id
        path
        target
      }
    }
    nodes {
      id
      path
      target
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

Variables

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

firstnumber

Returns up to the first `n` elements from the list.

afterstring

Returns the elements that come after the specified cursor.

lastnumber

Returns up to the last `n` elements from the list.

beforestring

Returns the elements that come before the specified cursor.

reverseboolean

Reverse the order of the underlying list.

querystring

Apply one or multiple filters to the query. | name | description | acceptable_values | default_value | example_use | | ---- | ---- | ---- | ---- | ---- | | created_at | | path | | target | Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more information about using filters.

json
{
  "first": 0,
  "after": "string",
  "last": 0,
  "before": "string",
  "reverse": false,
  "query": "string"
}

Response

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

edgesarray<object>
cursorobject
nodeobject
nodesarray<object>
idobject
pathobject
targetobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring

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

Was this page helpful?
urlRedirects — Shopify Storefront — Documentation