Skip to content
Guides
Queries

product

Retrieve complete visible product details by slug.

Last updated:

product retrieves the detailed representation of a product published in the resolved store.

Signature

product(slug: String!): ProductDetail!

Arguments

ArgumentTypeRequiredRule
slugString!YesTrimmed before lookup and limited to 200 characters.

The slug identifies the product's public URL; it is not its opaque ID.

Return value

ProductDetail exposes:

FieldTypeDescription
idString!Opaque product ID.
nameString!Published name.
slugString!Public slug.
descriptionString!Published description.
productTypeString!Product type returned by the catalog.
statusString!Published status.
imageUrlString!Primary image.
priceDecimal!Current price.
compareAtPriceDecimalCompare-at price, when present.
isAvailableBoolean!Whether the product can currently be sold.
totalInventoryInt!Total inventory reported by this read.
brandString!Brand.
categoryString!Category.
categoryIdStringOpaque category ID, when present.
tags[String!]!Published tags.
specifications[SpecItem!]!Product specifications.
variants[VariantItem!]!Published variants.
images[ImageItem!]!Product gallery.
bundleItems[BundleItem!]!Components when the product is a bundle.
sizeGuideSizeGuideInfoAssigned size guide, when present.
priceTiers[ProductPriceTier!]!Quantity pricing.
createdAtDateTimeCreation time available in the projection.
updatedAtDateTimeUpdate time available in the projection.
sellerProductSellerInfoAssociated seller, when present.

Nested types

Specifications, images, and seller

TypeFields
SpecItemkey: String!, name: String!, value: String!
ImageItemurl: String!, name: String!, order: Int!
ProductSellerInfoid: String!, name: String!, slug: String!

VariantItem

FieldTypeFieldType
idStringskuString!
statusString!priceDecimal!
compareAtPriceDecimalquantityInt!
isAvailableBooleanrequiresShippingBoolean!
options[SpecItem!]!images[ImageItem!]!

BundleItem

FieldTypeFieldType
productIdString!variantIdString!
productNameString!variantNameString
skuStringbrandString
imageUrlStringquantityInt!
availableInt!allowBackordersBoolean!
requiresShippingBoolean!

Size guide

SizeGuideInfo contains id, name, slug, description, imageUrl, gender, measurementType, unit, notes, and rows.

  • id, name, slug, gender, measurementType, and unit are String!.
  • description, imageUrl, and notes are String.
  • rows is [SizeGuideRowInfo!]!.
  • SizeGuideRowInfo contains label: String!, sizeKey: String!, order: Int!, and measurements: [SizeGuideMeasurementInfo!]!.
  • SizeGuideMeasurementInfo contains key: String!, name: String!, min: Decimal, max: Decimal, value: Decimal, and description: String.

ProductPriceTier

FieldType
variantIdString!
minQuantityInt!
maxQuantityInt
unitPriceDecimal!

Query

Product.graphql
query Product($slug: String!) {
  product(slug: $slug) {
    id
    name
    slug
    description
    productType
    status
    imageUrl
    price
    compareAtPrice
    isAvailable
    totalInventory
    brand
    category
    categoryId
    tags
    specifications { key name value }
    variants {
      id
      sku
      status
      price
      compareAtPrice
      quantity
      isAvailable
      requiresShipping
      options { key name value }
      images { url name order }
    }
    images { url name order }
    bundleItems {
      productId
      variantId
      productName
      variantName
      sku
      brand
      imageUrl
      quantity
      available
      allowBackorders
      requiresShipping
    }
    sizeGuide {
      id
      name
      slug
      description
      imageUrl
      gender
      measurementType
      unit
      notes
      rows {
        label
        sizeKey
        order
        measurements { key name min max value description }
      }
    }
    priceTiers { variantId minQuantity maxQuantity unitPrice }
    createdAt
    updatedAt
    seller { id name slug }
  }
}

Variables:

Variables
{
  "slug": "mug"
}

cURL

Terminal
curl --request POST "https://storefront.ecomiq.pe/graphql" \
  --header "Content-Type: application/json" \
  --header "x-Store-Domain: my-store" \
  --data-binary '{
    "query": "query Product($slug: String!) { product(slug: $slug) { id name slug description productType status imageUrl price compareAtPrice isAvailable totalInventory brand category categoryId tags specifications { key name value } variants { id sku status price compareAtPrice quantity isAvailable requiresShipping options { key name value } images { url name order } } images { url name order } bundleItems { productId variantId productName variantName sku brand imageUrl quantity available allowBackorders requiresShipping } sizeGuide { id name slug description imageUrl gender measurementType unit notes rows { label sizeKey order measurements { key name min max value description } } } priceTiers { variantId minQuantity maxQuantity unitPrice } createdAt updatedAt seller { id name slug } } }",
    "variables": { "slug": "mug" }
  }'

Response

This example preserves the values and absences covered by the host fixture:

Response
{
  "data": {
    "product": {
      "id": "456",
      "name": "Mug",
      "slug": "mug",
      "description": "A mug",
      "productType": "Product",
      "status": "Active",
      "imageUrl": "/mug.jpg",
      "price": 10,
      "compareAtPrice": null,
      "isAvailable": true,
      "totalInventory": 3,
      "brand": "Acme",
      "category": "Home",
      "categoryId": null,
      "tags": [],
      "specifications": [],
      "variants": [],
      "images": [],
      "bundleItems": [],
      "sizeGuide": null,
      "priceTiers": [],
      "createdAt": null,
      "updatedAt": null,
      "seller": null
    }
  }
}

Errors

CodeCommon cause
BAD_USER_INPUTslug is blank or longer than 200 characters.
NOT_FOUNDThe product does not exist or is not visible in the store.
STORE_CONTEXT_REQUIREDx-Store-Domain did not resolve a store.

See GraphQL errors before using data.

On this page