InventoryQuantity
An inventory quantity record that provides detailed information about stock levels, including the associated inventory, quantity available, location, alarm threshold, SKU, and low stock status.
Type Definition
type InventoryQuantity {
inventory: Inventory!
quantity: Int!
location: String
alarmLevel: Int
sku: String
isLowOnStock: Boolean!
}
Fields
Field | Type | Nullability | Description | Related Types |
---|---|---|---|---|
inventory | Inventory | Non-null | The inventory object for this quantity record. | Inventory |
quantity | Int | Non-null | The stock quantity in this inventory. | Int |
location | String | Nullable | The location of the inventory. | String |
alarmLevel | Int | Nullable | The alarm level for this inventory. | Int |
sku | String | Nullable | The stock keeping unit (SKU) for this inventory. | String |
isLowOnStock | Boolean | Non-null | True if product is low on stock in this inventory. | Boolean |
Relationships
- inventory: Links to the
Inventory
object type, representing the broader inventory context this quantity belongs to. - quantity and alarmLevel: Numeric fields that provide stock count and alert thresholds.
- sku: Connects this quantity record to a specific stock keeping unit identifier.
- isLowOnStock: A computed Boolean indicating if the stock quantity is below the alarm level or defined low stock threshold.
Usage Examples
Basic Query
{
inventoryQuantity {
inventory {
id
name
}
quantity
location
alarmLevel
sku
isLowOnStock
}
}
Field Selection
{
inventoryQuantity {
quantity
isLowOnStock
}
}
Nested Queries
{
inventoryQuantity {
inventory {
id
name
description
}
sku
quantity
isLowOnStock
}
}
Filtering and Sorting
{
inventoryQuantities(filter: { isLowOnStock: true }, sort: { field: quantity, direction: ASC }) {
edges {
node {
sku
quantity
alarmLevel
location
isLowOnStock
}
}
}
}
Implements
This type does not implement any interfaces.
Connections
This type may be part of connection queries such as inventoryQuantities
that support pagination, filtering, and sorting based on fields like isLowOnStock
and quantity
.
Related Types
- Inventory: The parent inventory object linked via the
inventory
field. - Int: Scalar type used for numeric fields
quantity
andalarmLevel
. - Boolean: Scalar type used for the
isLowOnStock
field.
Best Practices
- Always query
isLowOnStock
to quickly identify inventory items that require restocking. - Use the
alarmLevel
field to set and adjust thresholds for low stock alerts. - When querying multiple inventory quantities, apply filtering on
isLowOnStock
and sorting onquantity
to optimize data retrieval. - Include
inventory
nested fields to provide context about the inventory source.
Notes
- The
isLowOnStock
field is a computed Boolean that reflects whether the currentquantity
is below thealarmLevel
or other low stock criteria defined internally. - The API currently requires no authentication but this may change in future versions.
- To optimize performance, avoid querying unnecessary nested fields within
inventory
unless required. - Pagination and filtering capabilities are available on collections of
InventoryQuantity
objects to handle large datasets efficiently.
Last updated on