graphql filer options do not represent filters data
Frage
When I query the test site with chomeIQL extension using the query:
query category($cat: String) {
products(filter: {category_id: {eq: $cat}}) {
filters {
name
filter_items {
label
value_string
__typename
}
}
}
}
I get filters like:
"name": "Fashion Color",
"filter_items": [
{
"label": "Gold",
"value_string": "14",
"__typename": "LayerFilterItem"
},
{
"label": "Peach",
"value_string": "18",
"__typename": "LayerFilterItem"
},
But the graphQl docs (Docs => Query => Producs => filter) is of type ProductFilerInput and that has nothing resembling color.
The data for the price is:
{
"name": "Price",
"filter_items": [
{
"label": "<span class=\"price\">$0.00</span> - <span class=\"price\">$99.99</span>",
"value_string": "-100",
"__typename": "LayerFilterItem"
},
{
"label": "<span class=\"price\">$100.00</span> and above",
"value_string": "100-",
"__typename": "LayerFilterItem"
}
]
}
How does that represent ProductFilterInput.price which is FilterTypeInput ({gt:String,lt:String ...}
?
Is this caused by settings not being correct or is it a thing with Magento graphql not fully compatible with the rest of the application?
Lösung
This is caused because graphql part is not hooked up to configurable product.
what about filtering for things such as Fashion Material or size, etc? Those attributes are part of ConfigurableProduct but I wasn't able to filter for them. See magento/pwa-studio#1432