List of the search results.


Returns the elements that come after the specified cursor.

Returns the elements that come before the specified cursor.

Returns up to the first n elements from the list.

Returns up to the last n elements from the list.

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

Returns a subset of products matching all product filters.

The input must not contain more than 250 values.

The search query.

Anchor to reverse
reverse
default:false

Reverse the order of the underlying list.

Anchor to sortKey
sortKey
default:RELEVANCE

Sort the underlying list by the given key.

The types of resources to search for.

The input must not contain more than 250 values.

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


Was this section helpful?

A list of the nodes contained in SearchResultItemEdge.

Information to aid in pagination.

A list of available filters.

The total number of results.


Was this section helpful?

Examples

Hide code
DescriptionCopy
query searchProducts($query: String!, $first: Int) {
  search(query: $query, first: $first, types: PRODUCT) {
    edges {
      node {
        ... on Product {
          id
          title
        }
      }
    }
  }
}
Hide code
Response
JSON
{
  "search": {
    "edges": [
      {
        "node": {
          "id": "gid://shopify/Product/1",
          "title": "The Toggle Snowboard"
        }
      },
      {
        "node": {
          "id": "gid://shopify/Product/2",
          "title": "The .dev Snowboard"
        }
      },
      {
        "node": {
          "id": "gid://shopify/Product/3",
          "title": "The Hydrogen Snowboard"
        }
      }
    ]
  }
}