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

Update category-list.md #8313

Merged
merged 4 commits into from
Dec 8, 2020
Merged
Changes from 1 commit
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
80 changes: 80 additions & 0 deletions src/guides/v2.3/graphql/queries/category-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,86 @@ The following query returns breadcrumb information about categories that have th
}
```

### Return the categoryList by url_key filters

The following query returns information about category by url_key filters. You have to pass url_key value without suffix with `eq` or `in` keyword. Get the categoryList response from the `Gear` category.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following query returns information about category by url_key filters. You have to pass url_key value without suffix with `eq` or `in` keyword. Get the categoryList response from the `Gear` category.
The following query returns information about categories by `url_key` filters. You have to pass the `url_key` value without a suffix and with either the `eq` or `in` keywords. Get the categoryList response from the `Gear` category.


**Request:**

```graphql
{
categoryList(filters: { url_key: { eq: "gear" } }) {
id
level
name
path
url_path
url_key
children_count
}
}
```

**Response:**

```json
{
"data": {
"categoryList": [
{
"id": 3,
"level": 2,
"name": "Gear",
"path": "1/2/3",
"url_path": "gear",
"url_key": "gear",
"children_count": "3"
}
]
}
}
```

### Return the categoryList by url_path filters

The following query returns information about category by url_path filters. You have to pass url_path value without suffix with `eq` or `in` keyword. Get the categoryList response from the `Gear -> Bags` category.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following query returns information about category by url_path filters. You have to pass url_path value without suffix with `eq` or `in` keyword. Get the categoryList response from the `Gear -> Bags` category.
The following query returns information about categories by `url_path` filters. You have to pass the `url_path` value without a suffix and with either the `eq` or `in` keywords. Get the categoryList response from the `Gear -> Bags` category.


**Request:**

```graphql
{
categoryList(filters: { url_path: { eq: "gear/bags" } }) {
id
level
name
path
url_path
url_key
children_count
}
}
```

**Response:**

```json
{
"data": {
"categoryList": [
{
"id": 4,
"level": 3,
"name": "Bags",
"path": "1/2/3/4",
"url_path": "gear/bags",
"url_key": "bags",
"children_count": "0"
}
]
}
}
```

## Input attributes

You must specify the `filters` attribute as input to your query.
Expand Down