Docs
Dashboard

productVariants

Query

Returns a list of product variants.

#

Arguments


after
String

Returns the elements in the list that come after the specified cursor.

before
String

Returns the elements in the list that come before the specified cursor.

first
Int

Returns the first n elements from the list.

last
Int

Returns the last n elements from the list.

locale
String

The locale used by this operation.

priceChannelId
ID

The price channel id used by this operation.

priceCountry
String

The price country used by this operation.

priceCurrency
String

The price currency used by this operation.

query
String
A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters18
  • defaultstring

    Searches indexed variant and parent-product text such as names, SKUs, barcodes, vendors, and tags. Every term must match.

    ExamplesLAMP-01 blue"Blue Large"
  • idID

    Matches a product variant by its unique identifier.

    Exampleid:vid_...
  • namestring

    Matches the variant name. Phrases and prefix wildcards are supported.

    Examplesname:"Blue / Large"name:blu*
  • skustring

    Matches the variant SKU.

    Examplesku:LAMP-01-BLUE
  • barcodestring

    Matches the variant barcode.

    Examplebarcode:5712345678901
  • statusstring

    Matches the variant's lifecycle status.

    Examplestatus:active
  • product.idID

    Matches variants belonging to the specified product.

    Exampleproduct.id:product_...
  • product.namestring

    Matches the parent product name.

    Exampleproduct.name:"Portable Lamp"
  • product.vendorstring

    Matches the parent product vendor.

    Exampleproduct.vendor:acme
  • product.tagsstring

    Matches a tag assigned to the parent product.

    Exampleproduct.tags:lighting
  • product.categoriesID

    Matches variants whose parent product is assigned to the specified category.

    Exampleproduct.categories:cat_...
  • product.collectionsID

    Matches variants whose parent product is assigned to the specified collection.

    Exampleproduct.collections:col_...
  • metadata.<key>string

    Matches, prefix-matches, or checks for an indexed metadata value.

    Examplesmetadata.import_source:erpmetadata.import_source:*
  • metafields.<namespace>.<key>string | number

    Matches a public variant metafield value, checks for its presence, or compares a numeric value.

    Examplesmetafields.specs.material:oakmetafields.specs.wattage:>=40
  • product.metafields.<namespace>.<key>string | number

    Matches an indexed public metafield on the parent product.

    Exampleproduct.metafields.specs.material:oak
  • attributes.<attribute-name>string

    Matches a variant attribute value.

    Exampleattributes.color:blue
  • available_for_saleboolean

    Matches variants that are or are not available for sale in the current request context.

    Exampleavailable_for_sale:true
  • priceinteger

    Compares the best eligible price in minor currency units. The priceCurrency argument is required.

    Examplesprice:>=5000price:>=5000 AND price:<10000
sortDirection
SortDirection!Required

The direction used to order the returned resources.

Possible enum values
  • ASC

    Orders values from lowest to highest or alphabetically from A to Z.

  • DESC

    Orders values from highest to lowest or alphabetically from Z to A.

sortKey
ProductVariantSortKeys!Required

The field used to order the returned resources.

Possible enum values
  • ID

    Orders variants by their identifier.

  • NAME

    Orders variants alphabetically by name.

  • SKU

    Orders variants alphanumerically by SKU.

storeId
ID

The store id used by this operation.

#

Payload


edges
[ProductVariantEdge!]

A list of edges.

facets
[Facet!]!

Gets the configured facets for product variants in the current connection.

nodes
[ProductVariant!]

A flattened list of the nodes

pageInfo
PageInfo!

Information to aid in pagination.

totalCount
Int!

Identifies the total count of items in the connection.