Skip to Content

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

FieldTypeNullableDescriptionRelationship
handleStringYesReturns the handle.
minQuantityIntYesReturns the minimum quantity that can be bought.
maxQuantityIntYesReturns the maximum quantity that can be bought.
seoDescriptionStringYesReturns description for search engines.
seoTitleStringYesReturns title for search engines.
seoKeywordsStringYesReturns keywords for search engines.
idIntYesReturns the id.
combinedListingCombinedListingYesReturns the combined listing.CombinedListing
firstAvailableVariantProductVariantYesReturns the first available variant.ProductVariant
hasOnlyDefaultVariantBooleanYesReturns true if product has only default variant.
variants[ProductVariant]YesReturns the variants.ProductVariant
options[String]YesReturns the options handles.
optionsWithValues[ProductOption]YesReturns array of options.ProductOption
optionsByHandle[ProductOption]YesReturns array of options indexed by handle.ProductOption
defaultOrSelectedVariantProductVariantYesReturn the selected variant or the default one if none is selected.ProductVariant
tags[String]YesReturns product tags.
customFields[CustomField]YesReturns product custom fields as CustomFieldDrop objects.CustomField
inPreviewBooleanYesReturns true if product is in preview.
isAvailableBooleanYesReturns true if product is available for purchase.
isDirectlyBuyableBooleanYesReturns true if product can be bought without selecting any attributes.
titleStringYesReturns the title.
manufacturerManufacturerYesReturns the manufacturer.Manufacturer
shortDescriptionStringYesReturns the short description.
descriptionStringYesReturns the description.
compatible[Product]YesReturns the compatible products.Product
similar[Product]YesReturns the similar products.Product
related[Product]YesReturns the related products.Product
delivererDelivererYesReturns the deliverer.Deliverer
productGroups[ProductGroup]YesReturns the associated product groups.ProductGroup
returnPolicyTimeLimitIntYesReturns the product return policy time limit in days.
ratingFloatYesReturns the rating.
reviewCountIntYesReturns the review count.
maxRatingIntYesReturns the maximum rating.
reviews[Review]YesReturns the reviews.Review
attachments[Attachment]YesReturns the product attachments as AttachmentDrop objects.Attachment
reviewsAreEnabledBooleanYesReturns true if reviews are enabled for this product.
reviewsRequireAccountBooleanYesReturns true if creating a review for this product requires an account.
reviewsRequirePurchaseBooleanYesReturns true if product must be purchased before review can be made.
reviewsRequireApprovalBooleanYesReturns true if reviews are approved before published.
taxonomyProductTaxonomyYesReturns the taxonomy.ProductTaxonomy
createdAtStringYesReturns the creation date.
updatedAtStringYesReturns the last updated date.
rateStringYesReturns the tax rate.
inCustomersWishlistStringYesReturns true if product is in customer’s wishlist.
customerHasReviewedStringYesReturns true if customer has reviewed the product.
customerCanReviewStringYesReturns true if customer can review the product.
customerHasPurchasedStringYesReturns 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 of ProductVariant objects representing the different variants of the product.
  • reviews returns a list of Review objects associated with the product.
  • productGroups returns a list of ProductGroup objects categorizing the product.
  • compatible, similar, and related return lists of Product objects representing relationships to other products.
  • 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 or defaultOrSelectedVariant to efficiently retrieve a single relevant variant.
  • Use filtering and sorting on fields like tags, rating, and reviewCount 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 and isDirectlyBuyable 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 or reviews, consider implementing pagination to manage large datasets efficiently.
  • The createdAt and updatedAt fields are ISO 8601 formatted strings representing timestamps.
  • Fields such as inCustomersWishlist, customerHasReviewed, customerCanReview, and customerHasPurchased 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, and rating to reduce server load.

For more information on related object types, refer to their respective documentation sections.

Last updated on