I want to get the attribute label value along with the id in the Products graphQL query.
like color { id: 12, label: black }, size{ id: 15, label: xl }
Currently, it returns the id only.
How can I extend the current query?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityTry This
query($url: String!) {
products(filter: { url_key: { eq: $url } }) {
items {
id
sku
name
... on ConfigurableProduct {
configurable_options {
id
attribute_id_v2
use_default
attribute_code
label
position
values {
value_index
label
swatch_data {
__typename
value
}
}
product_id
}
variants {
attributes {
label
code
value_index
}
product {
id
name
sku
stock_status
short_description {
html
}
description {
html
}
image {
url
label
}
small_image {
url
label
}
media_gallery {
url
label
... on ProductVideo {
video_content {
media_type
video_provider
video_url
video_title
video_description
video_metadata
}
}
}
price_range {
minimum_price {
regular_price {
value
currency
}
final_price {
value
currency
}
discount {
amount_off
percent_off
}
}
}
}
}
}
}
total_count
}
}