products
QueryRetrieves a paged list of products with optional filtering, sorting, and full-text search.
Arguments
- String
after Returns the elements in the list that come after the specified cursor.
- String
before Returns the elements in the list that come before the specified cursor.
- Int
first Returns the first n elements from the list.
- Int
last Returns the last n elements from the list.
- String
query - A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters14
defaultstringSearches indexed product text such as names, vendors, SKUs, and tags. Every term must match.
Examplesportable lamp"Portable Lamp"idIDMatches a product by its unique identifier.
Exampleid:product_...namestringMatches the product name. Phrases and prefix wildcards are supported.
Examplesname:"Portable Lamp"name:port*vendorstringMatches the product vendor.
Examplevendor:acmestatusstringMatches the product's lifecycle status.
Examplestatus:activeskustringMatches the SKU of any variant belonging to the product.
Examplesku:LAMP-01variant_idIDMatches a product containing the specified variant.
Examplevariant_id:vid_...tagstringMatches a tag assigned to the product.
Exampletag:lightingcategory_idIDMatches a product assigned to the specified category.
Examplecategory_id:cat_...collection_idIDMatches a product assigned to the specified collection.
Examplecollection_id:col_...metadata.<key>stringMatches, prefix-matches, or checks for an indexed metadata value.
Examplesmetadata.import_source:erpmetadata.import_source:*metafields.<namespace>.<key>string | numberMatches a public metafield value, checks for its presence, or compares a numeric value.
Examplesmetafields.specs.material:oakmetafields.specs.wattage:>=40attributes.<attribute-name>stringMatches a product attribute value.
Exampleattributes.color:blueavailable_for_salebooleanMatches products that are or are not available for sale in the current request context.
Exampleavailable_for_sale:true
- SortDirection
sortDirection Sort direction (ascending or descending).
Possible enum valuesASCOrders values from lowest to highest or alphabetically from A to Z.
DESCOrders values from highest to lowest or alphabetically from Z to A.
- ProductSortKeys
sortKey Field key to sort by.
Possible enum valuesIDSort by product identifier.
NAMESort by product name.
PRICESorts by product variant prices, if ASC is specified, it will sort by the lowest price of the variants. If DESC is specified, it will sort by the highest price of the variants.
VENDORSort by the vendor value.
Payload
- [ProductEdge!]
edges A list of edges.
- [Product!]
nodes A flattened list of the nodes
- PageInfo!
pageInfo Information to aid in pagination.
- Int!
totalCount Identifies the total count of items in the connection.