I'm having a problem with the GraphQL API for Magento 2. I cannot retrieve the attribute value of multiselect or dropdown attributes when I retrieve my products.
In this example my attribute "material" returns an integer of the value ID instead of the textual value. I'm currently using the endpoint https://devdocs.magento.com/guides/v2.3/graphql/reference/custom-attribute-metadata.html to retrieve all the option values, but this is not very efficient.
{
products(
search: "Chair"
pageSize: 10
)
{
total_count
items {
name
sku
material
price {
regularPrice {
amount {
value
currency
}
}
}
}
page_info {
page_size
current_page
}
}
}
returns:
{
"data": {
"products": {
"total_count": 48,
"items": [
{
"name": "Brown Chair",
"sku": "4203894",
"material": 209,
"price": {
"regularPrice": {
"amount": {
"value": 89,
"currency": "EUR"
}
}
}
},
.......
Is there a way to get the textual value of the "material" attribute ("Leather") in this call?