Storefront GraphQL APIReferenceQueries
Product By Id
QUERY
productById(id: String!): StorefrontProductArguments
id*String!Returns
- productById
_id*ID!title*String!handle?Stringstatus?ProductStatusProduct status
Value in
PUBLISHEDDRAFTtype?ProductTypeProduct type
Value in
PHYSICALVIRTUALDOWNLOADABLEgallery?thumbnail?shortDescription?StringlongDescription?StringinformationSections?technicalSpecs?price?FloatbuyingPrice?FloatcomparingPrice?FloatisInStock?BooleantrackInventory?BooleanlowStockThreshold?FloatallowBackorder?Booleanvariants?variantConfigs?collections?vendors?tenant?StringcreatedAt?DateTimeA date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
updatedAt?DateTimeA date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
Example Request
query ProductById($id: String!) { productById(id: $id) { _id title handle status type gallery { fileAssetId provider key external alt } thumbnail { fileAssetId provider key external alt } shortDescription longDescription price }}{ "id": "string"}{ "data": { "productById": { "_id": "1", "title": "string", "handle": "string", "status": "PUBLISHED", "type": "PHYSICAL", "gallery": [ { "fileAssetId": "1", "provider": "CLOUDINARY", "key": "string", "external": "string", "alt": "string" } ], "thumbnail": { "fileAssetId": "1", "provider": "CLOUDINARY", "key": "string", "external": "string", "alt": "string" }, "shortDescription": "string", "longDescription": "string", "price": 10.5 } }}