GraphQL

Interfaces & Types

Each Product Details field has its own GraphQL type, named after the field’s handle. Queries shows how to request the field through Craft’s entry queries and set up the schema.

The [fieldHandle]_SnipcartField Type

A Product Details field with the handle productDetails returns the productDetails_SnipcartField type. Select any of these fields on it. All of them are nullable.

{
  entries(section: "products", limit: 1) {
    ... on product_Entry {
      productDetails {
        sku
        price
        inventory
      }
    }
  }
}

sku

The SKU of this product, which Snipcart uses as the item’s ID. This is null when no SKU is set.

price

The price of this product. This is null when no price is set.

shippable

Whether this product is shippable.

taxable

Whether this product is taxable.

weight

The weight of this product, in the unit given by weightUnit. This is null when no weight is set.

weightUnit

The unit for weight, which is grams, ounces or pounds.

length

The length of this product, in the unit given by dimensionsUnit. This is null when no length is set.

width

The width of this product, in the unit given by dimensionsUnit. This is null when no width is set.

height

The height of this product, in the unit given by dimensionsUnit. This is null when no height is set.

inventory

The number of this product in stock. This is null when no inventory is set.

dimensionsUnit

The unit for length, width and height, which is centimeters or inches.