FilterValue
Describes a filter value used to refine product listings or search results by providing count, label, parameter name, and an optional taxonomy value.
Type Definition
type FilterValue {
count: Int
label: String
paramName: String
taxonomyValue: ProductTaxonomyValue
}
Fields
Field | Type | Nullable | Description | Relationship |
---|---|---|---|---|
count | Int | Yes | The number of results matching this filter value. | None |
label | String | Yes | The display label for this filter value. | None |
paramName | String | Yes | The value associated with this filter option. | None |
taxonomyValue | ProductTaxonomyValue | Yes | The related taxonomy value for this filter value. | Links to ProductTaxonomyValue |
Relationships
- taxonomyValue: Connects to the
ProductTaxonomyValue
object type, providing additional structured taxonomy data related to this filter value. This relationship enables traversing from a filter value to its taxonomy metadata for richer filtering capabilities.
Usage Examples
Basic Query
{
filterValue {
count
label
paramName
}
}
Field Selection
{
filterValue {
label
paramName
}
}
Nested Queries
{
filterValue {
label
taxonomyValue {
id
name
description
}
}
}
Filtering and Sorting
Filtering and sorting are typically applied at the query level when requesting lists of filter values. For example, you might filter filter values by label or sort by count in your query arguments (if supported by the API). Since FilterValue
itself does not define arguments for filtering or sorting, these operations depend on the parent query or connection.
Example (hypothetical parent query usage):
{
filters(filterBy: { label_contains: "Red" }, sortBy: COUNT_DESC) {
maxValue {
label
count
}
}
}
Implements
This type does not implement any interfaces.
Connections
FilterValue
is used as a field type in other objects such as Filter.maxValue
and Filter.minValue
. It does not define connection fields itself.
Related Types
- ProductTaxonomyValue: Represents taxonomy metadata related to a filter value, allowing for hierarchical or categorized filtering.
Best Practices
- Use the
count
field to display how many products or results match a given filter value, improving user experience by showing filter impact. - Utilize the
paramName
field to pass filter parameters in queries or URLs for consistent filtering behavior. - When available, leverage the
taxonomyValue
relationship to provide richer filter context or to build nested filter UIs. - Always check for nullability on optional fields to avoid runtime errors in your client applications.
Notes
- The API currently requires no authentication, but this may change in future versions.
- Since all fields are optional, clients should implement null checks when accessing
FilterValue
fields. - Performance considerations: Avoid requesting deeply nested
taxonomyValue
fields unless necessary, as this may increase query complexity and response time. - No computed or derived fields are defined on
FilterValue
. - No field arguments are defined on
FilterValue
fields.
Last updated on