Product
Describes a product.
Type Definition
type Product {
handle: String
minQuantity: Int
maxQuantity: Int
seoDescription: String
seoTitle: String
seoKeywords: String
id: Int
combinedListing: CombinedListing
firstAvailableVariant: ProductVariant
hasOnlyDefaultVariant: Boolean
variants: [ProductVariant]
options: [String]
optionsWithValues: [ProductOption]
optionsByHandle: [ProductOption]
defaultOrSelectedVariant: ProductVariant
tags: [String]
customFields: [CustomField]
inPreview: Boolean
isAvailable: Boolean
isDirectlyBuyable: Boolean
title: String
manufacturer: Manufacturer
shortDescription: String
description: String
compatible: [Product]
similar: [Product]
related: [Product]
deliverer: Deliverer
productGroups: [ProductGroup]
returnPolicyTimeLimit: Int
rating: Float
reviewCount: Int
maxRating: Int
reviews: [Review]
attachments: [Attachment]
reviewsAreEnabled: Boolean
reviewsRequireAccount: Boolean
reviewsRequirePurchase: Boolean
reviewsRequireApproval: Boolean
taxonomy: ProductTaxonomy
createdAt: String
updatedAt: String
rate: String
inCustomersWishlist: String
customerHasReviewed: String
customerCanReview: String
customerHasPurchased: String
}
Fields
Field | Type | Nullable | Description | Relationship |
---|---|---|---|---|
handle | String | Yes | Returns the handle. | |
minQuantity | Int | Yes | Returns the minimum quantity that can be bought. | |
maxQuantity | Int | Yes | Returns the maximum quantity that can be bought. | |
seoDescription | String | Yes | Returns description for search engines. | |
seoTitle | String | Yes | Returns title for search engines. | |
seoKeywords | String | Yes | Returns keywords for search engines. | |
id | Int | Yes | Returns the id. | |
combinedListing | CombinedListing | Yes | Returns the combined listing. | CombinedListing |
firstAvailableVariant | ProductVariant | Yes | Returns the first available variant. | ProductVariant |
hasOnlyDefaultVariant | Boolean | Yes | Returns true if product has only default variant. | |
variants | [ProductVariant] | Yes | Returns the variants. | ProductVariant |
options | [String] | Yes | Returns the options handles. | |
optionsWithValues | [ProductOption] | Yes | Returns array of options. | ProductOption |
optionsByHandle | [ProductOption] | Yes | Returns array of options indexed by handle. | ProductOption |
defaultOrSelectedVariant | ProductVariant | Yes | Return the selected variant or the default one if none is selected. | ProductVariant |
tags | [String] | Yes | Returns product tags. | |
customFields | [CustomField] | Yes | Returns product custom fields as CustomFieldDrop objects. | CustomField |
inPreview | Boolean | Yes | Returns true if product is in preview. | |
isAvailable | Boolean | Yes | Returns true if product is available for purchase. | |
isDirectlyBuyable | Boolean | Yes | Returns true if product can be bought without selecting any attributes. | |
title | String | Yes | Returns the title. | |
manufacturer | Manufacturer | Yes | Returns the manufacturer. | Manufacturer |
shortDescription | String | Yes | Returns the short description. | |
description | String | Yes | Returns the description. | |
compatible | [Product] | Yes | Returns the compatible products. | Product |
similar | [Product] | Yes | Returns the similar products. | Product |
related | [Product] | Yes | Returns the related products. | Product |
deliverer | Deliverer | Yes | Returns the deliverer. | Deliverer |
productGroups | [ProductGroup] | Yes | Returns the associated product groups. | ProductGroup |
returnPolicyTimeLimit | Int | Yes | Returns the product return policy time limit in days. | |
rating | Float | Yes | Returns the rating. | |
reviewCount | Int | Yes | Returns the review count. | |
maxRating | Int | Yes | Returns the maximum rating. | |
reviews | [Review] | Yes | Returns the reviews. | Review |
attachments | [Attachment] | Yes | Returns the product attachments as AttachmentDrop objects. | Attachment |
reviewsAreEnabled | Boolean | Yes | Returns true if reviews are enabled for this product. | |
reviewsRequireAccount | Boolean | Yes | Returns true if creating a review for this product requires an account. | |
reviewsRequirePurchase | Boolean | Yes | Returns true if product must be purchased before review can be made. | |
reviewsRequireApproval | Boolean | Yes | Returns true if reviews are approved before published. | |
taxonomy | ProductTaxonomy | Yes | Returns the taxonomy. | ProductTaxonomy |
createdAt | String | Yes | Returns the creation date. | |
updatedAt | String | Yes | Returns the last updated date. | |
rate | String | Yes | Returns the tax rate. | |
inCustomersWishlist | String | Yes | Returns true if product is in customer’s wishlist. | |
customerHasReviewed | String | Yes | Returns true if customer has reviewed the product. | |
customerCanReview | String | Yes | Returns true if customer can review the product. | |
customerHasPurchased | String | Yes | Returns true if customer has purchased the product. |
Relationships
- combinedListing: Links to a
CombinedListing
object representing combined product listings. - firstAvailableVariant, defaultOrSelectedVariant, variants: Connect to one or more
ProductVariant
objects representing product variants. - optionsWithValues, optionsByHandle: Arrays of
ProductOption
objects providing detailed option data. - manufacturer: Links to a
Manufacturer
object providing manufacturer details. - compatible, similar, related: Arrays of related
Product
objects indicating compatibility, similarity, or relatedness. - deliverer: Links to a
Deliverer
object representing the product’s deliverer. - productGroups: Array of
ProductGroup
objects representing associated product categories or groups. - reviews: Array of
Review
objects containing product reviews. - attachments: Array of
Attachment
objects representing product attachments. - taxonomy: Links to a
ProductTaxonomy
object representing product classification.
Usage Examples
Basic Query
{
product(id: 12345) {
id
title
handle
isAvailable
minQuantity
maxQuantity
}
}
Field Selection
{
product(id: 12345) {
title
description
seoTitle
seoDescription
seoKeywords
tags
rating
reviewCount
}
}
Nested Queries
{
product(id: 12345) {
title
manufacturer {
id
name
}
firstAvailableVariant {
id
sku
price
}
reviews {
id
rating
comment
createdAt
}
productGroups {
id
title
}
}
}
Filtering and Sorting
{
products(filter: { tags: ["summer", "sale"] }, sort: { field: "rating", direction: DESC }, first: 10) {
edges {
node {
id
title
rating
reviewCount
}
}
}
}
Implements
This type does not explicitly implement any interfaces.
Connections
variants
returns a list ofProductVariant
objects representing the different variants of the product.reviews
returns a list ofReview
objects associated with the product.productGroups
returns a list ofProductGroup
objects categorizing the product.compatible
,similar
, andrelated
return lists ofProduct
objects representing relationships to other products.
Related Types
CombinedListing
ProductVariant
ProductOption
CustomField
Manufacturer
Product
Deliverer
ProductGroup
Review
Attachment
ProductTaxonomy
Best Practices
- Use the
id
field to uniquely identify products in queries and mutations. - When querying variants, prefer
firstAvailableVariant
ordefaultOrSelectedVariant
to efficiently retrieve a single relevant variant. - Use filtering and sorting on fields like
tags
,rating
, andreviewCount
to optimize product listings. - Leverage nested queries to fetch related data such as manufacturer details, reviews, and product groups in a single request.
- Use
isAvailable
andisDirectlyBuyable
to determine product purchase eligibility before displaying purchase options. - Utilize SEO-related fields (
seoTitle
,seoDescription
,seoKeywords
) to enhance search engine optimization. - Check review-related flags (
reviewsAreEnabled
,reviewsRequireAccount
, etc.) to conditionally display review UI elements. - Use
customFields
to access additional product metadata for advanced customization.
Notes
- All fields are optional and may return
null
if data is unavailable. - The API currently requires no authentication, but this may change in future versions.
- When querying lists such as
variants
orreviews
, consider implementing pagination to manage large datasets efficiently. - The
createdAt
andupdatedAt
fields are ISO 8601 formatted strings representing timestamps. - Fields such as
inCustomersWishlist
,customerHasReviewed
,customerCanReview
, andcustomerHasPurchased
return string values indicating boolean states; handle accordingly in your client. - Performance can be improved by selecting only the fields you need, especially when querying nested relationships.
- Use caching strategies on frequently accessed fields like
id
,title
, andrating
to reduce server load.
For more information on related object types, refer to their respective documentation sections.
Last updated on