Magento with GraphQl, Filter Range Type Input used to filter the query by the range type like from and to.
This type used to filter the response based on the selection of range value of from and to.
I hope you are aware of the Use FilterEqualTypeInput and FilterMatchTypeInput in GraphQl Magento.
Keep in mind, It Used with Price and Date type Attribute only.
input FilterRangeTypeInput @doc(description: "Defines a filter that matches a range of values, such as prices or dates.") { from: String @doc(description: "The beginning of the range") to: String @doc(description: "The end of the range") }
Example to use of Range Type Input,
We will filter out the Product response by the price type, A result will be fallen under the price of product between 20 to 30 range from the Catalog,
{ products( filter: { price: { from: "20", to: "30" } } ) { items { id name sku price_range { minimum_price { final_price { value currency } } } } } }
The Result will be all the products that have prices between 20 to 30.