The commercetools API operation failed: Unexpected error.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3558488. -->
Reported by: [kir lazur](https://www.drupal.org/user/2332532)
Related to !81
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The commercetools API operation failed: Unexpected error.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>On product listing page in filter block, when user choose color and enters price range value for i.e "from" , in return "Unexpected error." received.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p><code>Client error response [url] drupal-connector-demo-lifestyle/graphql [status code] 400 [reason phrase] Bad Request</code><br>
<strong>Below exception message:</strong><br>
<code>Variable '$queryFilters' expected value of type '[SearchFilterInput!]' but got: [{"model":{"value":{"path":"variants.attributes.color.en-US","values":["Tan:#D2B48C"]}}},{"model":{"range":{"path":"variants.price.centAmount","ranges":{"0":"Tan:#D2B48C","from":"1500","to":"*"}}}}]. Reason: '[0].model.range.ranges[0].0' Field '0' is not defined in the input type 'RangeElementInput'.</code></p>
<pre>query getProductProjectionSearch($limit: Int $offset: Int $sorts: [String!] $facets: [SearchFacetInput!] $filters: [SearchFilterInput!] $queryFilters: [SearchFilterInput!] $text: String $locale: Locale $storeProjection: String){<br> productProjectionSearch(limit: $limit offset: $offset sorts: $sorts facets: $facets filters: $filters queryFilters: $queryFilters text: $text locale: $locale storeProjection: $storeProjection) {<br> total<br> results {<br> id<br> productType {<br> id<br> key<br> name<br> }<br> slug(acceptLanguage: ["en-US","en-GB"])<br> name(acceptLanguage: ["en-US","en-GB"])<br> masterVariant {<br> id<br> sku<br> images {<br> url<br> label<br> }<br> attributesRaw(includeNames: ["productspec","color","finish","new-arrival","size","product-description","product-description","product-spec","color","finish"]) {<br> name<br> value<br> }<br> price(currency: "USD" country: "US") {<br> value {<br> centAmount<br> currencyCode<br> fractionDigits<br> }<br> discounted {<br> value {<br> centAmount<br> currencyCode<br> fractionDigits<br> }<br> }<br> }<br> availability {<br> noChannel {<br> availableQuantity<br> }<br> }<br> }<br> }<br> }<br>}</pre><pre>array (<br> 'queryFilters' => <br> array (<br> 0 => <br> array (<br> 'model' => <br> array (<br> 'value' => <br> array (<br> 'path' => 'variants.attributes.color.en-US',<br> 'values' => <br> array (<br> 0 => 'Tan:#D2B48C',<br> ),<br> ),<br> ),<br> ),<br> 1 => <br> array (<br> 'model' => <br> array (<br> 'range' => <br> array (<br> 'path' => 'variants.price.centAmount',<br> 'ranges' => <br> array (<br> 0 => 'Tan:#D2B48C',<br> 'from' => '1500',<br> 'to' => '*',<br> ),<br> ),<br> ),<br> ),<br> ),<br> 'limit' => 9,<br>)</pre>
issue