Skip to Content

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

FieldTypeNullabilityDescriptionRelated Types
inventoryInventoryNon-nullThe inventory object for this quantity record.Inventory
quantityIntNon-nullThe stock quantity in this inventory.Int
locationStringNullableThe location of the inventory.String
alarmLevelIntNullableThe alarm level for this inventory.Int
skuStringNullableThe stock keeping unit (SKU) for this inventory.String
isLowOnStockBooleanNon-nullTrue 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.

  • Inventory: The parent inventory object linked via the inventory field.
  • Int: Scalar type used for numeric fields quantity and alarmLevel.
  • 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 on quantity 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 current quantity is below the alarmLevel 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