younifyd
Menu

search

Full storefront search across products (with filters/facets) and, optionally, articles and pages.

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the search action (under Search).
  3. Fill in the fields below, then reference the result from later steps as {{search.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 Search($first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: SearchSortKeys, $query: String!, $prefix: SearchPrefixQueryType, $productFilters: [ProductFilter!], $types: [SearchType!], $unavailableProducts: SearchUnavailableProductsType) {
  search(
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
    sortKey: $sortKey
    query: $query
    prefix: $prefix
    productFilters: $productFilters
    types: $types
    unavailableProducts: $unavailableProducts
  ) {
    edges {
      cursor
      node
    }
    nodes
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    productFilters {
      id
      label
      presentation
      type
      values {
        count
        id
        image
        input
        label
        swatch
      }
    }
    totalCount
  }
}

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.

sortKeystring

Sort the underlying list by the given key.

One ofPRICERELEVANCE

querystringrequired

The search query.

prefixstring

Specifies whether to perform a partial word match on the last search term.

One ofLASTNONE

productFiltersarray<object>

Returns a subset of products matching all product filters. The input must not contain more than `250` values.

availableboolean
variantOptionobject2 fields
categoryobject1 fields
taxonomyMetafieldobject3 fields
productTypestring
productVendorstring
priceobject2 fields
productMetafieldobject3 fields
variantMetafieldobject3 fields
tagstring
typesarray<string>

The types of resources to search for. The input must not contain more than `250` values.

unavailableProductsstring

Specifies how unavailable products or variants are displayed in the search results.

One ofSHOWHIDELAST

json
{
  "query": "string",
  "first": 0,
  "after": "string",
  "last": 0,
  "before": "string",
  "reverse": false,
  "sortKey": "PRICE",
  "prefix": "LAST",
  "productFilters": [
    {
      "available": false,
      "variantOption": {
        "name": "string",
        "value": "string"
      },
      "category": {
        "id": "string"
      },
      "taxonomyMetafield": {
        "namespace": "string",
        "key": "string",
        "value": "string"
      },
      "productType": "string",
      "productVendor": "string",
      "price": {
        "min": "string",
        "max": "string"
      },
      "productMetafield": {
        "namespace": "string",
        "key": "string",
        "value": "string"
      },
      "variantMetafield": {
        "namespace": "string",
        "key": "string",
        "value": "string"
      },
      "tag": "string"
    }
  ],
  "types": [
    "PRODUCT"
  ],
  "unavailableProducts": "SHOW"
}

Response

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

edgesarray<object>
cursorobject
nodeobject
nodesarray<object>
authorobject
authorV2object
blogobject
contentHtmlobject
excerptHtmlobject
handleobject
idobject
imageobject
onlineStoreUrlobject
publishedAtobject
seoobject
tagsobject
titleobject
trackingParametersobject
bodyobject
bodySummaryobject
createdAtobject
updatedAtobject
availableForSaleobject
categoryobject
compareAtPriceRangeobject
descriptionHtmlobject
encodedVariantAvailabilityobject
encodedVariantExistenceobject
featuredImageobject
isGiftCardobject
priceRangeobject
productTypeobject
requiresSellingPlanobject
totalInventoryobject
variantsCountobject
vendorobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring
productFiltersarray<object>
idobject
labelobject
presentationobject
typeobject
valuesobject
totalCountnumber

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

Was this page helpful?