Product interface implementations
Adobe Commerce and Magento Open Source provides multiple product types, and most of these product types have specialized attributes that are not defined in the [ProductInterface
(https://developer.adobe.com/commerce/webapi/graphql-api/index.html#definition-ProductInterface)].
Product type | Implements | Has product-specific attributes? |
---|---|---|
Yes | ||
Yes | ||
Yes | ||
Yes | ||
Yes | ||
No | ||
No |
Query for product-specific attributes
To return attributes that are specific to a product type, append a structure similar to the following to the end of the Products
output object:
Copied to your clipboard... on <ProductType> {items{<ProductType-attribute1><ProductType-attribute2>...}}
For example, to return GroupedProduct
attributes, construct your query like this:
Copied to your clipboard{products(filter:{sku: {eq: "24-WG085_Group"}}){items {uidnamesku__typename... on GroupedProduct {items{qtypositionproduct{skuname__typenameurl_key}}}}}}
Copied to your clipboard{"data": {"products": {"items": [{"uid": "NDU=","name": "Set of Sprite Yoga Straps","sku": "24-WG085_Group","__typename": "GroupedProduct","items": [{"qty": 0,"position": 0,"product": {"sku": "24-WG085","name": "Sprite Yoga Strap 6 foot","__typename": "SimpleProduct","url_key": "sprite-yoga-strap-6-foot"}},{"qty": 0,"position": 1,"product": {"sku": "24-WG086","name": "Sprite Yoga Strap 8 foot","__typename": "SimpleProduct","url_key": "sprite-yoga-strap-8-foot"}},{"qty": 0,"position": 2,"product": {"sku": "24-WG087","name": "Sprite Yoga Strap 10 foot","__typename": "SimpleProduct","url_key": "sprite-yoga-strap-10-foot"}}]}]}}}