Skip to content
This repository was 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 all 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
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 the Gear category using a `url_key` filter. You must pass the `url_key` value without a suffix and specify either the `eq` or `in` keyword.

**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 the Gear > Bags category using the `url_path` filter. Do not specify a suffix in the `url_path` value. The `url_path` filter accepts either the `eq` or `in` keyword.

**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