import { ShopifyProduct } from '@daffodil/driver/shopify'
Represents an item listed in a shop's catalog.
Products support multiple product variants, representing different versions of the same product, and can include various media types. Use the selectedOrFirstAvailableVariant or variantBySelectedOptions fields to help customers find the right variant based on their selections.
Products can be organized into collections, associated with selling plans for subscriptions, and extended with custom data through metafields.
Learn more about working with products and collections.
interface ShopifyProduct {
__typename: "Product"
adjacentVariants: ShopifyProductVariant[]
availableForSale: boolean
category: ShopifyTaxonomyCategory
collections: ShopifyCollectionConnection
compareAtPriceRange: ShopifyProductPriceRange
createdAt: Scalars['DateTime']['output']
description: string
descriptionHtml: Scalars['HTML']['output']
encodedVariantAvailability: string
encodedVariantExistence: string
featuredImage: ShopifyImage
handle: string
id: string
images: ShopifyImageConnection
isGiftCard: boolean
media: ShopifyMediaConnection
metafield: ShopifyMetafield
metafields: ShopifyMetafield[]
onlineStoreUrl: Maybe<Scalars['URL']['output']>
options: ShopifyProductOption[]
priceRange: ShopifyProductPriceRange
productType: string
publishedAt: Scalars['DateTime']['output']
requiresSellingPlan: boolean
selectedOrFirstAvailableVariant: ShopifyProductVariant
sellingPlanGroups: ShopifySellingPlanGroupConnection
seo: ShopifySeo
tags: string[]
title: string
totalInventory: number
trackingParameters: string
updatedAt: Scalars['DateTime']['output']
variantBySelectedOptions: ShopifyProductVariant
variants: ShopifyProductVariantConnection
variantsCount: ShopifyCount
vendor: string
}
__typename "Product" |
|---|
adjacentVariants ShopifyProductVariant[] |
|---|
A list of variants whose selected options differ with the provided selected options by one, ordered by variant id. If selected options are not provided, adjacent variants to the first available variant is returned. Note that this field returns an array of variants. In most cases, the number of variants in this array will be low. However, with a low number of options and a high number of values per option, the number of variants returned here can be high. In such cases, it recommended to avoid using this field. This list of variants can be used in combination with the |
availableForSale boolean |
|---|
Indicates if at least one product variant is available for sale. |
category ShopifyTaxonomyCategory |
|---|
The category of a product from Shopify's Standard Product Taxonomy. |
collections ShopifyCollectionConnection |
|---|
A list of collections that include the product. |
compareAtPriceRange ShopifyProductPriceRange |
|---|
The compare-at price range of the product in the shop's default currency. |
createdAt Scalars['DateTime']['output'] |
|---|
The date and time when the product was created. |
description string |
|---|
A single-line description of the product, with HTML tags removed. |
descriptionHtml Scalars['HTML']['output'] |
|---|
The description of the product, with
HTML tags. For example, the description might include
bold |
encodedVariantAvailability string |
|---|
An encoded string containing all option value combinations with a corresponding variant that is currently available for sale. Integers represent option and values: [0,1] represents option_value at array index 0 for the option at array index 0
Decoding process: Example options: [Size, Color, Material] Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," Step 3: Expand shared prefixes so data is encoded as a string: "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," Step 4: Map to options + option values to determine existing variants: [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). |
encodedVariantExistence string |
|---|
An encoded string containing all option value combinations with a corresponding variant. Integers represent option and values: [0,1] represents option_value at array index 0 for the option at array index 0
Decoding process: Example options: [Size, Color, Material] Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," Step 3: Expand shared prefixes so data is encoded as a string: "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," Step 4: Map to options + option values to determine existing variants: [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). |
featuredImage ShopifyImage |
|---|
The featured image for the product. This field is functionally equivalent to |
handle string |
|---|
A unique, human-readable string of the product's title.
A handle can contain letters, hyphens ( |
id string |
|---|
A globally-unique ID. |
images ShopifyImageConnection |
|---|
List of images associated with the product. |
isGiftCard boolean |
|---|
Whether the product is a gift card. |
media ShopifyMediaConnection |
|---|
The media that are associated with the product. Valid media are images, 3D models, videos. |
metafield ShopifyMetafield |
|---|
A custom field, including its |
metafields ShopifyMetafield[] |
|---|
A list of custom fields that a merchant associates with a Shopify resource. |
onlineStoreUrl Maybe<Scalars['URL']['output']> |
|---|
The product's URL on the online store.
If |
options ShopifyProductOption[] |
|---|
A list of product options. The limit is defined by the shop's resource limits for product options ( |
priceRange ShopifyProductPriceRange |
|---|
The minimum and maximum prices of a product, expressed in decimal numbers. For example, if the product is priced between $10.00 and $50.00, then the price range is $10.00 - $50.00. |
productType string |
|---|
The product type that merchants define. |
publishedAt Scalars['DateTime']['output'] |
|---|
The date and time when the product was published to the channel. |
requiresSellingPlan boolean |
|---|
Whether the product can only be purchased with a selling plan. Products that are sold on subscription ( |
selectedOrFirstAvailableVariant ShopifyProductVariant |
|---|
Find an active product variant based on selected options, availability or the first variant. All arguments are optional. If no selected options are provided, the first available variant is returned. If no variants are available, the first variant is returned. |
sellingPlanGroups ShopifySellingPlanGroupConnection |
|---|
A list of all selling plan groups that are associated with the product either directly, or through the product's variants. |
seo ShopifySeo |
|---|
The SEO title and description that are associated with a product. |
tags string[] |
|---|
A comma-separated list of searchable keywords that are
associated with the product. For example, a merchant might apply the |
title string |
|---|
The name for the product that displays to customers. The title is used to construct the product's handle.
For example, if a product is titled "Black Sunglasses", then the handle is |
totalInventory number |
|---|
The quantity of inventory that's in stock. |
trackingParameters string |
|---|
URL parameters to be added to a page URL to track the origin of on-site search traffic for analytics reporting. Returns a result when accessed through the search or predictiveSearch queries, otherwise returns null. |
updatedAt Scalars['DateTime']['output'] |
|---|
The date and time when the product was last modified.
A product's |
variantBySelectedOptions ShopifyProductVariant |
|---|
Find a product’s variant based on its selected options.
This is useful for converting a user’s selection of product options into a single matching variant.
If there is not a variant for the selected options, |
variants ShopifyProductVariantConnection |
|---|
A list of variants that are associated with the product. |
variantsCount ShopifyCount |
|---|
The number of variants that are associated with the product. |
vendor string |
|---|
The name of the product's vendor. |