Menu
search
Full storefront search across products (with filters/facets) and, optionally, articles and pages.
Use it in a workflow
- Add a step and choose the Shopify Storefront connector.
- Pick the search action (under Search).
- 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.
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.
{
"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}}.
Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?