Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Added correct sort type for products query in graphql #6627

Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/guides/v2.3/graphql/queries/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ products(
filter: ProductAttributeFilterInput
pageSize: Int
currentPage: Int
sort: ProductSortFilterInput
sort: ProductAttributeSortInput
): Products
```

Expand Down Expand Up @@ -280,7 +280,7 @@ The `AggregationOption` array contains a list of possible options for the `attri
Attribute | Data type | Description
--- | --- | ---
`count` | Int | The number of items returned by the filter
`label` | String! | The label of the filter
`label` | String | The label of the filter
`value` | String! | The internal ID representing the value of the option

### ProductInterface attributes {#ProductInterface}
Expand Down Expand Up @@ -352,7 +352,7 @@ The following search returns items that contain the word `yoga` or `pants`. The

```graphql
{
products(search: "Yoga pants", pageSize: 10) {
products(search: "Yoga pants", pageSize: 2) {
total_count
items {
name
Expand Down Expand Up @@ -519,6 +519,9 @@ The following query returns aggregations for a query that filters on items with
- In the price range of $30 - $39.99
- Comes in black (color `49`)

{:.bs-callout-info}
By default, you cannot filter on the `color` attribute. [Filtering with custom attributes]({{page.baseurl}}/graphql/custom-filters.html) describe how to enable this attribute for filtering.

**Request:**

```graphql
Expand Down Expand Up @@ -1025,7 +1028,7 @@ In the following example, a catalog price rule that provides a 10% discount on a

### Sort by a custom attribute

In this example, the `description` attribute has been enabled by setting the **Stores** > Attributes > **Product** > description > **Storefront Properties** > **Use in Search** and **Used in Sorting in Product Listing** fields to Yes. The query returns all products with a price range of $28 to $30, sorted by the description.
In this example, the `description` attribute has been enabled by setting the **Stores** > Attributes > **Product** > description > **Storefront Properties** > **Use in Search** and **Used for Sorting in Product Listing** fields to Yes. The query returns all products with a price range of $28 to $30, sorted by the description.

**Request:**

Expand Down