> ## Documentation Index
> Fetch the complete documentation index at: https://developer.jtl-software.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QueryItemsByCategoryId

> Queries the items of a category. By default only items that are directly assigned to the category are returned; with "includeSubcategories", items assigned to any of its subcategories, including nested ones, are returned as well. Each item is returned once, even if it is assigned to several of these categories. Inactive categories are included. A category without items returns an empty list; an unknown category returns 404 Not Found. The items are ordered by their ID.



**query** `QueryItemsByCategoryId(categoryId: ID!, includeSubcategories: Boolean, first: Int, after: String, last: Int, before: String): QueryItemsByCategoryIdConnection`

## Arguments

**`categoryId`**: `ID!` (required)

---

**`includeSubcategories`**: `Boolean`

---

**`first`**: `Int`

Returns the first _n_ elements from the list.

---

**`after`**: `String`

Returns the elements in the list that come after the specified cursor.

---

**`last`**: `Int`

Returns the last _n_ elements from the list.

---

**`before`**: `String`

Returns the elements in the list that come before the specified cursor.

## Returns

`QueryItemsByCategoryIdConnection`

**`pageInfo`**: `PageInfo!`

Information to aid in pagination.

---

**`edges`**: `[QueryItemsByCategoryIdEdge!]`

A list of edges.

---

**`nodes`**: `[ItemListItem!]`

A flattened list of the nodes.

---

**`totalCount`**: `Int!`

Identifies the total count of items in the connection.

