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
| Argument | Type | Required | Rule |
|---|---|---|---|
slug | String! | Yes | Trimmed 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:
| Field | Type | Description |
|---|---|---|
id | String! | Opaque product ID. |
name | String! | Published name. |
slug | String! | Public slug. |
description | String! | Published description. |
productType | String! | Product type returned by the catalog. |
status | String! | Published status. |
imageUrl | String! | Primary image. |
price | Decimal! | Current price. |
compareAtPrice | Decimal | Compare-at price, when present. |
isAvailable | Boolean! | Whether the product can currently be sold. |
totalInventory | Int! | Total inventory reported by this read. |
brand | String! | Brand. |
category | String! | Category. |
categoryId | String | Opaque 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. |
sizeGuide | SizeGuideInfo | Assigned size guide, when present. |
priceTiers | [ProductPriceTier!]! | Quantity pricing. |
createdAt | DateTime | Creation time available in the projection. |
updatedAt | DateTime | Update time available in the projection. |
seller | ProductSellerInfo | Associated seller, when present. |
Nested types
Specifications, images, and seller
| Type | Fields |
|---|---|
SpecItem | key: String!, name: String!, value: String! |
ImageItem | url: String!, name: String!, order: Int! |
ProductSellerInfo | id: String!, name: String!, slug: String! |
VariantItem
| Field | Type | Field | Type |
|---|---|---|---|
id | String | sku | String! |
status | String! | price | Decimal! |
compareAtPrice | Decimal | quantity | Int! |
isAvailable | Boolean | requiresShipping | Boolean! |
options | [SpecItem!]! | images | [ImageItem!]! |
BundleItem
| Field | Type | Field | Type |
|---|---|---|---|
productId | String! | variantId | String! |
productName | String! | variantName | String |
sku | String | brand | String |
imageUrl | String | quantity | Int! |
available | Int! | allowBackorders | Boolean! |
requiresShipping | Boolean! |
Size guide
SizeGuideInfo contains id, name, slug, description, imageUrl, gender, measurementType, unit, notes, and rows.
id,name,slug,gender,measurementType, andunitareString!.description,imageUrl, andnotesareString.rowsis[SizeGuideRowInfo!]!.SizeGuideRowInfocontainslabel: String!,sizeKey: String!,order: Int!, andmeasurements: [SizeGuideMeasurementInfo!]!.SizeGuideMeasurementInfocontainskey: String!,name: String!,min: Decimal,max: Decimal,value: Decimal, anddescription: String.
ProductPriceTier
| Field | Type |
|---|---|
variantId | String! |
minQuantity | Int! |
maxQuantity | Int |
unitPrice | Decimal! |
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"
}cURL
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:
{
"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
| Code | Common cause |
|---|---|
BAD_USER_INPUT | slug is blank or longer than 200 characters. |
NOT_FOUND | The product does not exist or is not visible in the store. |
STORE_CONTEXT_REQUIRED | x-Store-Domain did not resolve a store. |
See GraphQL errors before using data.