# Queries

{% hint style="warning" %}
**Navixy Repository API is a work in progress.** This documentation is published for preview purposes only and doesn't reflect a stable release. Structure, field names, and behaviors are subject to change.
{% endhint %}

### roles

Lists roles for an organization.

```graphql
roles(
    organizationId: ID!
    filter: CatalogItemFilter
    first: Int
    after: String
    last: Int
    before: String
    orderBy: CatalogItemOrder = { field: ORDER, direction: ASC }
  ): RoleConnection!
```

**Arguments**

| Name             | Type                | Description                                                                                   |
| ---------------- | ------------------- | --------------------------------------------------------------------------------------------- |
| `organizationId` | `ID!`               | The organization to retrieve roles for.                                                       |
| `filter`         | `CatalogItemFilter` | Filtering options for the returned roles.                                                     |
| `first`          | `Int`               | The first `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).     |
| `after`          | `String`            | The elements that come after the specified [cursor](https://docs.navixy.com/api/pagination).  |
| `last`           | `Int`               | The last `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).      |
| `before`         | `String`            | The elements that come before the specified [cursor](https://docs.navixy.com/api/pagination). |
| `orderBy`        | `CatalogItemOrder`  | The ordering options for the returned roles.                                                  |

**Input types:**

<details>

<summary>CatalogItemFilter</summary>

Filtering options for catalog items.

| Field           | Type      | Description                                         |
| --------------- | --------- | --------------------------------------------------- |
| `titleContains` | `String`  | Partial match on title (case-insensitive contains). |
| `codes`         | `[Code!]` | Match any of these codes.                           |

</details>

<details>

<summary>CatalogItemOrder</summary>

Ordering options for catalog items.

| Field       | Type                                                                                                                          | Description             |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `field`     | [CatalogItemOrderField](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalogitemorderfield)! | The field to order by.  |
| `direction` | [OrderDirection](https://www.navixy.com/docs/navixy-repository-api/common#type-orderdirection)!                               | The direction to order. |

</details>

**Output types:**

<details>

<summary>RoleConnection</summary>

A paginated list of Role items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                                      | Description                                                |
| ---------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `edges`    | \[[RoleEdge](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-roleedge)!]! | A list of edges.                                           |
| `nodes`    | \[[Role](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-role)!]!         | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!                       | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo)                      | The total count of items matching the filter.              |

</details>

<details>

<summary>PageInfo (entity)</summary>

Information about the current page in a paginated connection.

| Field             | Type       | Description                                                |
| ----------------- | ---------- | ---------------------------------------------------------- |
| `hasNextPage`     | `Boolean!` | Whether more items exist after the current page.           |
| `hasPreviousPage` | `Boolean!` | Whether more items exist before the current page.          |
| `startCursor`     | `String`   | The cursor pointing to the first item in the current page. |
| `endCursor`       | `String`   | The cursor pointing to the last item in the current page.  |

</details>

***

### actorRoles

Lists actor role assignments for an organization.

```graphql
actorRoles(
    organizationId: ID!
    filter: ActorRoleFilter
    first: Int
    after: String
    last: Int
    before: String
    orderBy: ActorRoleOrder = { field: ASSIGNED_AT, direction: DESC }
  ): ActorRoleConnection!
```

**Arguments**

| Name             | Type              | Description                                                                                   |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------- |
| `organizationId` | `ID!`             | The organization to retrieve actor roles for.                                                 |
| `filter`         | `ActorRoleFilter` | Filtering options for the returned actor roles.                                               |
| `first`          | `Int`             | The first `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).     |
| `after`          | `String`          | The elements that come after the specified [cursor](https://docs.navixy.com/api/pagination).  |
| `last`           | `Int`             | The last `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).      |
| `before`         | `String`          | The elements that come before the specified [cursor](https://docs.navixy.com/api/pagination). |
| `orderBy`        | `ActorRoleOrder`  | The ordering options for the returned actor roles.                                            |

**Input types:**

<details>

<summary>ActorRoleFilter</summary>

Filtering options for actor roles.

| Field            | Type      | Description                         |
| ---------------- | --------- | ----------------------------------- |
| `actorIds`       | `[ID!]`   | Filter by actors (OR within field). |
| `roleIds`        | `[ID!]`   | Filter by roles (OR within field).  |
| `includeExpired` | `Boolean` | Include expired role assignments.   |

</details>

<details>

<summary>ActorRoleOrder</summary>

Ordering options for actor roles.

| Field       | Type                                                                                                                        | Description             |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `field`     | [ActorRoleOrderField](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-actorroleorderfield)! | The field to order by.  |
| `direction` | [OrderDirection](https://www.navixy.com/docs/navixy-repository-api/common#type-orderdirection)!                             | The direction to order. |

</details>

**Output types:**

<details>

<summary>ActorRoleConnection</summary>

A paginated list of ActorRole items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                                                | Description                                                |
| ---------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `edges`    | \[[ActorRoleEdge](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-actorroleedge)!]! | A list of edges.                                           |
| `nodes`    | \[[ActorRole](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-actorrole)!]!         | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!                                 | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo)                                | The total count of items matching the filter.              |

</details>

<details>

<summary>PageInfo (entity)</summary>

Information about the current page in a paginated connection.

| Field             | Type       | Description                                                |
| ----------------- | ---------- | ---------------------------------------------------------- |
| `hasNextPage`     | `Boolean!` | Whether more items exist after the current page.           |
| `hasPreviousPage` | `Boolean!` | Whether more items exist before the current page.          |
| `startCursor`     | `String`   | The cursor pointing to the first item in the current page. |
| `endCursor`       | `String`   | The cursor pointing to the last item in the current page.  |

</details>

***

### rolePermissions

Lists role permissions for an organization.

```graphql
rolePermissions(
    organizationId: ID!
    filter: RolePermissionFilter
    first: Int
    after: String
    last: Int
    before: String
    orderBy: RolePermissionOrder = { field: GRANTED_AT, direction: DESC }
  ): RolePermissionConnection!
```

**Arguments**

| Name             | Type                   | Description                                                                                   |
| ---------------- | ---------------------- | --------------------------------------------------------------------------------------------- |
| `organizationId` | `ID!`                  | The organization to retrieve role permissions for.                                            |
| `filter`         | `RolePermissionFilter` | Filtering options for the returned role permissions.                                          |
| `first`          | `Int`                  | The first `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).     |
| `after`          | `String`               | The elements that come after the specified [cursor](https://docs.navixy.com/api/pagination).  |
| `last`           | `Int`                  | The last `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).      |
| `before`         | `String`               | The elements that come before the specified [cursor](https://docs.navixy.com/api/pagination). |
| `orderBy`        | `RolePermissionOrder`  | The ordering options for the returned role permissions.                                       |

**Input types:**

<details>

<summary>RolePermissionFilter</summary>

Filtering options for role permissions.

| Field                | Type    | Description                                    |
| -------------------- | ------- | ---------------------------------------------- |
| `roleIds`            | `[ID!]` | Filter by roles (OR within field).             |
| `permissionScopeIds` | `[ID!]` | Filter by permission scopes (OR within field). |
| `targetEntityIds`    | `[ID!]` | Filter by target entities (OR within field).   |

</details>

<details>

<summary>RolePermissionOrder</summary>

Ordering options for role permissions.

| Field       | Type                                                                                                                                  | Description             |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `field`     | [RolePermissionOrderField](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-rolepermissionorderfield)! | The field to order by.  |
| `direction` | [OrderDirection](https://www.navixy.com/docs/navixy-repository-api/common#type-orderdirection)!                                       | The direction to order. |

</details>

**Output types:**

<details>

<summary>RolePermissionConnection</summary>

A paginated list of RolePermission items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                                                          | Description                                                |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `edges`    | \[[RolePermissionEdge](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-rolepermissionedge)!]! | A list of edges.                                           |
| `nodes`    | \[[RolePermission](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-rolepermission)!]!         | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!                                           | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo)                                          | The total count of items matching the filter.              |

</details>

<details>

<summary>PageInfo (entity)</summary>

Information about the current page in a paginated connection.

| Field             | Type       | Description                                                |
| ----------------- | ---------- | ---------------------------------------------------------- |
| `hasNextPage`     | `Boolean!` | Whether more items exist after the current page.           |
| `hasPreviousPage` | `Boolean!` | Whether more items exist before the current page.          |
| `startCursor`     | `String`   | The cursor pointing to the first item in the current page. |
| `endCursor`       | `String`   | The cursor pointing to the last item in the current page.  |

</details>

***

### userScopes

Lists user scope restrictions for an organization.

```graphql
userScopes(
    organizationId: ID!
    filter: UserScopeFilter
    first: Int
    after: String
    last: Int
    before: String
    orderBy: UserScopeOrder = { field: ID, direction: ASC }
  ): UserScopeConnection!
```

**Arguments**

| Name             | Type              | Description                                                                                   |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------- |
| `organizationId` | `ID!`             | The organization to retrieve user scopes for.                                                 |
| `filter`         | `UserScopeFilter` | Filtering options for the returned user scopes.                                               |
| `first`          | `Int`             | The first `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).     |
| `after`          | `String`          | The elements that come after the specified [cursor](https://docs.navixy.com/api/pagination).  |
| `last`           | `Int`             | The last `n` elements from the [paginated list](https://docs.navixy.com/api/pagination).      |
| `before`         | `String`          | The elements that come before the specified [cursor](https://docs.navixy.com/api/pagination). |
| `orderBy`        | `UserScopeOrder`  | The ordering options for the returned user scopes.                                            |

**Input types:**

<details>

<summary>UserScopeFilter</summary>

Filtering options for user scopes.

| Field                | Type    | Description                                    |
| -------------------- | ------- | ---------------------------------------------- |
| `actorIds`           | `[ID!]` | Filter by actors (OR within field).            |
| `permissionScopeIds` | `[ID!]` | Filter by permission scopes (OR within field). |
| `targetEntityIds`    | `[ID!]` | Filter by target entities (OR within field).   |

</details>

<details>

<summary>UserScopeOrder</summary>

Ordering options for user scopes.

| Field       | Type                                                                                                                        | Description             |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `field`     | [UserScopeOrderField](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-userscopeorderfield)! | The field to order by.  |
| `direction` | [OrderDirection](https://www.navixy.com/docs/navixy-repository-api/common#type-orderdirection)!                             | The direction to order. |

</details>

**Output types:**

<details>

<summary>UserScopeConnection</summary>

A paginated list of UserScope items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                                                | Description                                                |
| ---------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `edges`    | \[[UserScopeEdge](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-userscopeedge)!]! | A list of edges.                                           |
| `nodes`    | \[[UserScope](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/types#type-userscope)!]!         | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!                                 | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo)                                | The total count of items matching the filter.              |

</details>

<details>

<summary>PageInfo (entity)</summary>

Information about the current page in a paginated connection.

| Field             | Type       | Description                                                |
| ----------------- | ---------- | ---------------------------------------------------------- |
| `hasNextPage`     | `Boolean!` | Whether more items exist after the current page.           |
| `hasPreviousPage` | `Boolean!` | Whether more items exist before the current page.          |
| `startCursor`     | `String`   | The cursor pointing to the first item in the current page. |
| `endCursor`       | `String`   | The cursor pointing to the last item in the current page.  |

</details>

***
