Query employee profiles, permissions, and B2B store access.
query GetEmployee($id: ID) {
Employee(id: $id) {
id
employee_number
first_name
last_name
email
phone
position
notes
employable { id }
employable_type
employer { ... on Customer { id label } ... on Supplier { id label } }
b2b_store_settings
b2b_store_status
address { id }
user_profile { id }
active
created_at
updated_at
label
}
}
query Employees(
$orderBy: [QueryEmployeesOrderByOrderByClause!],
$where: QueryEmployeesWhereWhereConditions,
$search: String,
$first: Int,
$page: Int,
$trashed: Trashed
) {
Employees(
orderBy: $orderBy
where: $where
search: $search
first: $first
page: $page
trashed: $trashed
) {
paginatorInfo {
total
currentPage
}
data {
id
employee_number
first_name
last_name
email
phone
active
employer { ... on Customer { label } ... on Supplier { label } }
}
}
}
{
"where": {
"AND": [
{ "column": "ACTIVE", "operator": "EQ", "value": true }
]
},
"orderBy": [
{ "column": "LAST_NAME", "order": "ASC" }
],
"search": "employee name or email"
}
| Field | Type | Description |
|---|
id | Int | Unique identifier of the employee. |
label | String | Computed label (first_name + last_name). |
employee_number | String | Employee reference number. |
first_name | String | Employee's first name. |
last_name | String | Employee's last name. |
email | String | Employee's email address. |
phone | String | Phone number. |
position | String | Employee's position/role. |
notes | String | Notes about the employee. |
employable | Employable | Associated employable entity. |
employable_type | String | Type of the employable entity. |
employer | Union | Employer (Customer or Supplier). |
b2b_store_settings | JSON | B2B store configuration settings. |
b2b_store_status | B2bStoreStatus | B2B store access status. |
address | Address | Employee's address. |
user_profile | UserProfile | Associated user profile. |
active | Boolean | Employee's activation status. |
created_at | DateTime | Creation date and time. |
updated_at | DateTime | Last update date and time. |
custom_fields | [EntityCustomField] | Custom fields for this entity. |
You can create filters based on following fields:
| id - Int |
|---|
Example: { "column": "ID", "operator": "EQ", "value": 10001 } |
| employee_number - String |
|---|
Example: { "column": "EMPLOYEE_NUMBER", "operator": "EQ", "value": "EMP-2025-001" } |
| phone - String |
|---|
Example: { "column": "PHONE", "operator": "EQ", "value": "+1234567890" } |
| active - Boolean |
|---|
Example: { "column": "ACTIVE", "operator": "EQ", "value": true } |
| b2b_store_status - B2bStoreStatus |
|---|
Example: { "column": "B2B_STORE_STATUS", "operator": "EQ", "value": "active" } |
| trashed - Filter by trashed status. Accepts ALL, TRASHED, or NOT_TRASHED. |
You can sort data based on following fields: first_name, last_name, email, phone, employee_number, active, user_profile_last_accessed_at
query SortEmployees(
$where: QueryEmployeesWhereWhereConditions,
$first: Int,
$page: Int
) {
Employees(
where: $where
orderBy: [{ column: LAST_NAME, order: ASC }]
first: $first
page: $page
) {
paginatorInfo {
total
currentPage
}
data {
id
first_name
last_name
email
employee_number
active
}
}
}
{
"data": {
"Employees": [
{
"id": 100001,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"employee_number": "EMP-2025-001",
"active": true
},
{
"id": 100002,
"first_name": "Jane",
"last_name": "Smith",
"email": "[email protected]",
"employee_number": "EMP-2025-002",
"active": true
}
]
}
}
| Field | Type | Description |
|---|
id | Int | Employable entity ID. |
label | String | Entity label/name. |
| Field | Type | Description |
|---|
id | ID | Entity ID (required). |
employable_type | String | Entity type: Customer or Supplier (required). |
| Value | Description |
|---|
pending | Access request pending approval. |
denied | Access request denied. |
active | Active B2B store access. |
disabled | B2B store access disabled. |