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

Commit 811c563

Browse files
authored
move categoryinterface out of category query (#5718)
1 parent 3687445 commit 811c563

File tree

4 files changed

+64
-56
lines changed

4 files changed

+64
-56
lines changed

_data/toc/graphql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ pages:
222222
- label: ProductInterface attributes
223223
url: /graphql/product/product-interface.html
224224

225+
- label: CategoryInterface attributes
226+
url: /graphql/product/category-interface.html
227+
225228
- label: CustomizableOptionInterface
226229
url: /graphql/product/customizable-option-interface.html
227230

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
group: graphql
3+
title: CategoryInterface attributes
4+
---
5+
6+
`CategoryInterface` defines attributes that can be returned in the [`category` query]({{page.baseurl}}/graphql/queries/category.html) and the [`products` query]({{page.baseurl}}/graphql/queries/products.html).
7+
8+
## CategoryInterface attributes
9+
10+
The following table defines the `CategoryInterface` attributes and objects.
11+
12+
Attribute | Type | Description
13+
--- | --- | ---
14+
`breadcrumbs` | [Breadcrumb] | A Breadcrumb object contains information the categories that comprise the breadcrumb trail for the specified category
15+
`created_at` | String | Timestamp indicating when the category was created
16+
`default_sort_by` | String | The attribute to use for sorting
17+
`description` | String | An optional description of the category
18+
`id` | Int | An ID that uniquely identifies the category
19+
`level` | Int | Indicates the depth of the category within the tree
20+
`name` | String | The display name of the category
21+
`path_in_store` | String | Category path in the store
22+
`path` | String | The path to the category, as a string of category IDs, separated by slashes (/). For example, 1/2/20
23+
`position` | Int | The position of the category relative to other categories at the same level in tree
24+
`product_count` | Int | The number of products in the category
25+
`products(<attributes>)` | CategoryProducts | The list of products assigned to the category
26+
`updated_at` | String | Timestamp indicating when the category was updated
27+
`url_key` | String | The URL key assigned to the category
28+
`url_path` | String | The URL path assigned to the category
29+
30+
### Breadcrumb object
31+
32+
A breadcrumb trail is a set of links that shows customers where they are in relation to other pages in the
33+
store.
34+
35+
Attribute | Data type | Description
36+
--- | --- | ---
37+
`category_id` | Int | An ID that uniquely identifies the category
38+
`category_level` | Int | Indicates the depth of the category within the tree
39+
`category_name` | String | The display name of the category
40+
`category_url_key` | String | The url key assigned to the category
41+
42+
### CategoryProducts object
43+
44+
The `products` attribute can contain the following attributes:
45+
46+
Attribute | Data type | Description
47+
--- | --- | ---
48+
`currentPage` | Int | Specifies which page of results to return. The default value is 1
49+
`pageSize` | Int | Specifies the maximum number of results to return at once. This attribute is optional. The default value is 20
50+
`sort` | `ProductSortInput` | Specifies which attribute to sort on, and whether to return the results in ascending or descending order. [Searches and pagination in GraphQL]({{ page.baseurl }}/graphql/search-pagination.html) describes sort orders
51+
52+
The `CategoryProducts` object contains the following attributes:
53+
54+
Attribute | Data type | Description
55+
--- | --- | ---
56+
`items` | [ProductInterface] | An array of products that are assigned to the category. See [ProductInterface]({{ page.baseurl }}/graphql/product/product-interface.html) for more information
57+
`page_info` | `SearchResultPageInfo` | An object that includes the `page_info` and `currentPage` values specified in the query
58+
`total_count` | Int | The number of products returned

guides/v2.3/graphql/product/product-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Attribute | Data type | Description
2222
--- | --- | ---
2323
`attribute_set_id` | Int | The attribute set assigned to the product
2424
`canonical_url` | String | The canonical URL for the product
25-
`categories` | [CategoryInterface] | The categories assigned to the product. See [categories query]({{ page.baseurl }}/graphql/queries/category.html) for more information
25+
`categories` | [[CategoryInterface]]({{ page.baseurl }}/graphql/product/category-interface.html) | The categories assigned to the product. See [CategoryInterface attributes]({{ page.baseurl }}/graphql/product/category-interface.html) for more information
2626
`country_of_manufacture` | String | The product's country of origin
2727
`created_at` | String | Timestamp indicating when the product was created
2828
`crosssell_products` | [ProductInterface] | An array of cross-sell products

guides/v2.3/graphql/queries/category.md

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -196,61 +196,8 @@ Attribute | Data type | Description
196196

197197
## Output attributes {#Categories}
198198

199-
The query returns a `CategoryTree` object, which implements `CategoryInterface`. It can contain the following top-level attributes:
199+
The query returns a `CategoryTree` object, which implements [`CategoryInterface`]({{page.baseurl}}/graphql/product/category-interface.html). The `CategoryTree` object can contain the following attribute, as we as all attributes defined in `CategoryInterface`:
200200

201201
Attribute | Data type | Description
202202
--- | --- | ---
203-
`breadcrumbs` | `Breadcrumb` | A `Breadcrumb` object contains information the categories that comprise the breadcrumb trail for the specified category
204-
`children` | `CategoryTree` | A `CategoryTree` object that contains information about a child category. You can specify up to 10 levels of child categories
205-
`created_at`| String | Timestamp indicating when the category was created
206-
`default_sort_by`| String | The attribute to use for sorting
207-
`description`| String | An optional description of the category
208-
`id` | Int | An ID that uniquely identifies the category
209-
`level` | Int | Indicates the depth of the category within the tree
210-
`name`| String | The display name of the category
211-
`path_in_store`| String | Category path in the store
212-
`path`| String | The path to the category, as a string of category IDs, separated by slashes (/). For example, `1/2/20`
213-
`position`| Int | The position of the category relative to other categories at the same level in tree
214-
`product_count`| Int | The number of products in the category
215-
`products(<attributes>)` | `CategoryProducts` | The list of products assigned to the category
216-
`updated_at`| String | Timestamp indicating when the category was updated
217-
`url_key`| String | The url key assigned to the category
218-
`url_path`| String | The url path assigned to the category
219-
220-
### CategoryProducts object
221-
222-
The `products` attribute can contain the following attributes:
223-
224-
Attribute | Data type | Description
225-
--- | --- | ---
226-
`currentPage` | Int | Specifies which page of results to return. The default value is 1
227-
`pageSize` | Int | Specifies the maximum number of results to return at once. This attribute is optional. The default value is 20
228-
`sort` | `ProductSortInput` | Specifies which attribute to sort on, and whether to return the results in ascending or descending order. [Searches and pagination in GraphQL]({{ page.baseurl }}/graphql/search-pagination.html) describes sort orders
229-
230-
The `CategoryProducts` object contains the following attributes:
231-
232-
Attribute | Data type | Description
233-
--- | --- | ---
234-
`items` | [ProductInterface] | An array of products that are assigned to the category. See [ProductInterface]({{ page.baseurl }}/graphql/product/product-interface.html) for more information
235-
`page_info` | `SearchResultPageInfo` | An object that includes the `page_info` and `currentPage` values specified in the query
236-
`total_count` | Int | The number of products returned
237-
238-
### Breadcrumb object
239-
240-
A breadcrumb trail is a set of links that shows customers where they are in relation to other pages in the
241-
store.
242-
243-
Attribute | Data type | Description
244-
--- | --- | ---
245-
`category_id` | Int | An ID that uniquely identifies the category
246-
`category_level` | Int | Indicates the depth of the category within the tree
247-
`category_name` | String | The display name of the category
248-
`category_url_key` | String | The url key assigned to the category
249-
250-
### CategoryTree object
251-
252-
This `CategoryTree` object contains information about the next level of subcategories of the category specified in the original query.
253-
254-
Attribute | Data type | Description
255-
--- | --- | ---
256-
`children` | [CategoryTree] | An array containing the next level of subcategories
203+
`children` | `CategoryTree` | An array containing the next level of subcategories. By default, you can specify up to 10 levels of child categories

0 commit comments

Comments
 (0)