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
CombinedListingobject representing combined product listings. - firstAvailableVariant, defaultOrSelectedVariant, variants: Connect to one or more
ProductVariantobjects representing product variants. - optionsWithValues, optionsByHandle: Arrays of
ProductOptionobjects providing detailed option data. - manufacturer: Links to a
Manufacturerobject providing manufacturer details. - compatible, similar, related: Arrays of related
Productobjects indicating compatibility, similarity, or relatedness. - deliverer: Links to a
Delivererobject representing the product’s deliverer. - productGroups: Array of
ProductGroupobjects representing associated product categories or groups. - reviews: Array of
Reviewobjects containing product reviews. - attachments: Array of
Attachmentobjects representing product attachments. - taxonomy: Links to a
ProductTaxonomyobject 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
variantsreturns a list ofProductVariantobjects representing the different variants of the product.reviewsreturns a list ofReviewobjects associated with the product.productGroupsreturns a list ofProductGroupobjects categorizing the product.compatible,similar, andrelatedreturn lists ofProductobjects representing relationships to other products.
Related Types
CombinedListingProductVariantProductOptionCustomFieldManufacturerProductDelivererProductGroupReviewAttachmentProductTaxonomy
Best Practices
- Use the
idfield to uniquely identify products in queries and mutations. - When querying variants, prefer
firstAvailableVariantordefaultOrSelectedVariantto efficiently retrieve a single relevant variant. - Use filtering and sorting on fields like
tags,rating, andreviewCountto optimize product listings. - Leverage nested queries to fetch related data such as manufacturer details, reviews, and product groups in a single request.
- Use
isAvailableandisDirectlyBuyableto 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
customFieldsto access additional product metadata for advanced customization.
Notes
- All fields are optional and may return
nullif data is unavailable. - The API currently requires no authentication, but this may change in future versions.
- When querying lists such as
variantsorreviews, consider implementing pagination to manage large datasets efficiently. - The
createdAtandupdatedAtfields are ISO 8601 formatted strings representing timestamps. - Fields such as
inCustomersWishlist,customerHasReviewed,customerCanReview, andcustomerHasPurchasedreturn 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, andratingto reduce server load.
For more information on related object types, refer to their respective documentation sections.
Last updated on