query GetSerialNumberInventoryLog($inventory_log_id: ID, $serial_number_id: ID) {
SerialNumberInventoryLog(inventory_log_id: $inventory_log_id, serial_number_id: $serial_number_id) {
inventory_log_id
serial_number_id
status
location_id
batch_number_id
serial_number {
id
label
status
}
inventory_log {
id
}
location {
id
label
}
batch_number {
id
label
}
}
}
{
"data": {
"SerialNumberInventoryLog": {
"inventory_log_id": 200001,
"serial_number_id": 50001,
"status": "active",
"location_id": 100245,
"batch_number_id": 100010,
"serial_number": {
"id": 50001,
"label": "SN-001",
"status": "active"
},
"inventory_log": { "id": 200001 },
"location": { "id": 100245, "label": "Warehouse A" },
"batch_number": { "id": 100010, "label": "BATCH-A001" }
}
}
}
query SerialNumberInventoryLogs(
$where: QuerySerialNumberInventoryLogsWhereWhereConditions,
$orderBy: [QuerySerialNumberInventoryLogsOrderByOrderByClause!]
) {
SerialNumberInventoryLogs(
where: $where
orderBy: $orderBy
) {
inventory_log_id
serial_number_id
status
location_id
batch_number_id
serial_number {
id
label
}
inventory_log {
id
}
location {
id
label
}
batch_number {
id
label
}
}
}
{
"where": {
"AND": [
{ "column": "SERIAL_NUMBER_ID", "operator": "EQ", "value": 50001 }
]
},
"orderBy": [
{ "column": "INVENTORY_LOG_ID", "order": "DESC" }
]
}
| Field | Type | Description |
|---|
inventory_log_id | Int | ID of the linked inventory log. |
serial_number_id | Int | ID of the linked serial number. |
status | String | Status of the serial number in this log entry. |
location_id | Int | ID of the linked location. |
batch_number_id | Int | ID of the linked batch number. |
serial_number | Object | Associated serial number entity. |
inventory_log | Object | Associated inventory log entity. |
location | Object | Associated location entity. |
batch_number | Object | Associated batch number entity. |
| Field | Example |
|---|
inventory_log_id | { "column": "INVENTORY_LOG_ID", "operator": "EQ", "value": 200001 } |
serial_number_id | { "column": "SERIAL_NUMBER_ID", "operator": "EQ", "value": 50001 } |
status | { "column": "STATUS", "operator": "EQ", "value": "active" } |
location_id | { "column": "LOCATION_ID", "operator": "EQ", "value": 100245 } |
batch_number_id | { "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 } |
serial_number_label | { "column": "SERIAL_NUMBER_LABEL", "operator": "LIKE", "value": "%SN-%" } |
You can sort data based on following fields: inventory_log_id, serial_number_id, status, location_id, batch_number_id
query SortSerialNumberInventoryLogs {
SerialNumberInventoryLogs(
orderBy: [{ column: SERIAL_NUMBER_ID, order: ASC }]
) {
inventory_log_id
serial_number_id
status
location_id
batch_number_id
serial_number {
id
label
}
}
}
{
"data": {
"SerialNumberInventoryLogs": [
{
"inventory_log_id": 200001,
"serial_number_id": 50001,
"status": "active",
"location_id": 100245,
"batch_number_id": 100010,
"serial_number": { "id": 50001, "label": "SN-001", "status": "active" },
"inventory_log": { "id": 200001 },
"location": { "id": 100245, "label": "Warehouse A" },
"batch_number": { "id": 100010, "label": "BATCH-A001" }
},
{
"inventory_log_id": 200002,
"serial_number_id": 50002,
"status": "sold",
"location_id": 100246,
"batch_number_id": 100011,
"serial_number": { "id": 50002, "label": "SN-002", "status": "sold" },
"inventory_log": { "id": 200002 },
"location": { "id": 100246, "label": "Warehouse B" },
"batch_number": { "id": 100011, "label": "BATCH-A002" }
}
]
}
}