ProductVariant

Required access

read_products access scope

Show definition
type ProductVariant implements Node, HasMetafields, Navigable {
  # Globally unique identifier.
  id: ID!

  # The metafield associated with the resource.
  metafield(
    # Container for a set of metafields (maximum of 20 characters).
    namespace: String!

    # Identifier for the metafield (maximum of 30 characters).
    key: String!
  ): Metafield

  # A paginated list of metafields associated with the resource.
  metafields(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): MetafieldConnection!

  # A default cursor for use in pagination.
  defaultCursor: String!

  # Indicates if the product variant is available for sale.
  availableForSale: Boolean!
  barcode: String
  compareAtPrice: Money
  createdAt: DateTime!

  # Display name of the variant, based on product's title + variant's title.
  displayName: String!
  fulfillmentService: FulfillmentService
  harmonizedSystemCode: String
  image(
    # Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
    maxWidth: Int

    # Image height in pixels between 1 and 2048. This argument is deprecated: Use
    # `maxHeight` on `Image.transformedSrc` instead.
    maxHeight: Int

    # Crops the image according to the specified region. This argument is
    # deprecated: Use `crop` on `Image.transformedSrc` instead.
    crop: CropRegion

    # Image size multiplier for high-resolution retina displays. Must be between 1
    # and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.
    scale: Int = 1
  ): Image
  images(
    # Truncate the array result to this size.
    first: Int

    # Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
    maxWidth: Int

    # Image height in pixels between 1 and 2048. This argument is deprecated: Use
    # `maxHeight` on `Image.transformedSrc` instead.
    maxHeight: Int

    # Crops the image according to the specified region. This argument is
    # deprecated: Use `crop` on `Image.transformedSrc` instead.
    crop: CropRegion

    # Image size multiplier for high-resolution retina displays. Must be between 1
    # and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.
    scale: Int = 1
  ): [Image!]!
  inventoryItem: InventoryItem!
  inventoryManagement: ProductVariantInventoryManagement!
  inventoryPolicy: ProductVariantInventoryPolicy!

  # Total sellable quantity of the variant
  inventoryQuantity: Int
  position: Int!
  price: Money!
  product: Product!
  requiresShipping: Boolean!

  # List of product options applied to the variant.
  selectedOptions: [SelectedOption!]!
  sku: String

  # The storefront ID of the product variant.
  storefrontId: StorefrontID!
  taxable: Boolean!
  title: String!
  updatedAt: DateTime!
  weight: Float
  weightUnit: WeightUnit!
}

Implements

Connections

metafields   (MetafieldConnection!)

A paginated list of metafields associated with the resource.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

Fields

availableForSale   (Boolean!)

Indicates if the product variant is available for sale.

barcode   (String)

compareAtPrice   (Money)

createdAt   (DateTime!)

defaultCursor   (String!)

A default cursor for use in pagination.

displayName   (String!)

Display name of the variant, based on product's title + variant's title.

fulfillmentService   (FulfillmentService)

harmonizedSystemCode   (String)

id   (ID!)

Globally unique identifier.

image   (Image)

Argument Type Default Description
crop CropRegion

Crops the image according to the specified region. This argument is deprecated: Use crop on Image.transformedSrc instead.

maxHeight Int

Image height in pixels between 1 and 2048. This argument is deprecated: Use maxHeight on Image.transformedSrc instead.

maxWidth Int

Image width in pixels between 1 and 2048. This argument is deprecated: Use maxWidth on Image.transformedSrc instead.

scale Int 1

Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use scale on Image.transformedSrc instead.

inventoryItem   (InventoryItem!)

inventoryManagement   (ProductVariantInventoryManagement!)

inventoryPolicy   (ProductVariantInventoryPolicy!)

inventoryQuantity   (Int)

Total sellable quantity of the variant

metafield   (Metafield)

The metafield associated with the resource.

Argument Type Default Description
key required String!

Identifier for the metafield (maximum of 30 characters).

namespace required String!

Container for a set of metafields (maximum of 20 characters).

position   (Int!)

price   (Money!)

product   (Product!)

requiresShipping   (Boolean!)

selectedOptions   ([SelectedOption!]!)

List of product options applied to the variant.

sku   (String)

storefrontId   (StorefrontID!)

The storefront ID of the product variant.

taxable   (Boolean!)

title   (String!)

updatedAt   (DateTime!)

weight   (Float)

weightUnit   (WeightUnit!)

Deprecated fields

Show/Hide

images   ([Image!]!) deprecated

Deprecation warning

Use the singular image field instead. There may never be more than one variant image.

Argument Type Default Description
crop CropRegion

Crops the image according to the specified region. This argument is deprecated: Use crop on Image.transformedSrc instead.

first Int

Truncate the array result to this size.

maxHeight Int

Image height in pixels between 1 and 2048. This argument is deprecated: Use maxHeight on Image.transformedSrc instead.

maxWidth Int

Image width in pixels between 1 and 2048. This argument is deprecated: Use maxWidth on Image.transformedSrc instead.

scale Int 1

Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use scale on Image.transformedSrc instead.