productVariants
QueryReturns a list of product variants.
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
locale The locale used by this operation.
- ID
priceChannelId The price channel id used by this operation.
- String
priceCountry The price country used by this operation.
- String
priceCurrency The price currency used by this operation.
- String
query - A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters18
defaultstringSearches indexed variant and parent-product text such as names, SKUs, barcodes, vendors, and tags. Every term must match.
ExamplesLAMP-01 blue"Blue Large"idIDMatches a product variant by its unique identifier.
Exampleid:vid_...namestringMatches the variant name. Phrases and prefix wildcards are supported.
Examplesname:"Blue / Large"name:blu*skustringMatches the variant SKU.
Examplesku:LAMP-01-BLUEbarcodestringMatches the variant barcode.
Examplebarcode:5712345678901statusstringMatches the variant's lifecycle status.
Examplestatus:activeproduct.idIDMatches variants belonging to the specified product.
Exampleproduct.id:product_...product.namestringMatches the parent product name.
Exampleproduct.name:"Portable Lamp"product.vendorstringMatches the parent product vendor.
Exampleproduct.vendor:acmeproduct.tagsstringMatches a tag assigned to the parent product.
Exampleproduct.tags:lightingproduct.categoriesIDMatches variants whose parent product is assigned to the specified category.
Exampleproduct.categories:cat_...product.collectionsIDMatches variants whose parent product is assigned to the specified collection.
Exampleproduct.collections: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 variant metafield value, checks for its presence, or compares a numeric value.
Examplesmetafields.specs.material:oakmetafields.specs.wattage:>=40product.metafields.<namespace>.<key>string | numberMatches an indexed public metafield on the parent product.
Exampleproduct.metafields.specs.material:oakattributes.<attribute-name>stringMatches a variant attribute value.
Exampleattributes.color:blueavailable_for_salebooleanMatches variants that are or are not available for sale in the current request context.
Exampleavailable_for_sale:truepriceintegerCompares the best eligible price in minor currency units. The priceCurrency argument is required.
Examplesprice:>=5000price:>=5000 AND price:<10000
- SortDirection!Required
sortDirection The direction used to order the returned resources.
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.
- ProductVariantSortKeys!Required
sortKey The field used to order the returned resources.
Possible enum valuesIDOrders variants by their identifier.
NAMEOrders variants alphabetically by name.
SKUOrders variants alphanumerically by SKU.
- ID
storeId The store id used by this operation.
Payload
- [ProductVariantEdge!]
edges A list of edges.
- [Facet!]!
facets Gets the configured facets for product variants in the current connection.
- [ProductVariant!]
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.