Docs
Dashboard

productVariants

Query

Retrieves a paged list of product variants with optional filtering, sorting, and full-text search capabilities.

#

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.

query
String
A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters17
  • 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
sortDirection
SortDirection

The sort direction.

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

The field by which to sort the variants. Supported values include:

Possible enum values
  • ID

    Orders variants by their identifier.

  • NAME

    Orders variants alphabetically by name.

  • SKU

    Orders variants alphanumerically by SKU.

#

Payload


edges
[ProductVariantEdge!]

A list of edges.

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.