Frontend API
Retrieve product attributes to display in storefront.
Returns a list of product attributes, with offset pagination using limit and page.
List attributes
await swell.attributes.list({
limit: 25,
page: 1
})
Returns a single attribute.
Get an attribute
await swell.attributes.get('color')Retrieve product attributes to display in a storefront.
List attributes
Returns a list of product attributes, with offset pagination using limit and page.
The parameters for this query are search, where, sort, limit, page, _locale, and _currency.
List attributes
# Returns 5 attributes per page, starting on page 1.
query getAttributes {
attributes(limit: 5, page: 1) {
count
results {
name
visible
type
values
}
}
}Get an attribute
Returns a single attribute by ID.
The parameters for this query are id, _locale, and _currency.
Get an attribute
# Returns all values entered in the 'color' attribute.
query getAttributeById {
attributeById(id: "color") {
name
visible
type
values
}
}