Stocks
Stocks Query
Returns a paginated list of Stock objects, with optional filtering and ordering.
Arguments
after
Cursor
Returns the elements in the list that come after the specified cursor
first
Int
Returns the first n elements from the list
before
Cursor
Returns the elements in the list that come before the specified cursor
last
Int
Returns the last n elements from the list
orderBy
StockOrder
Ordering options for Stocks returned from the connection
where
StockWhereInput
Filtering options for Stocks returned from the connection
Return Type
StockConnection! - A connection to a list of Stock objects with pagination information.
Stock Fields
id
ID!
Unique identifier
itemID
UUID!
ID of the inventory item
repositoryID
UUID!
ID of the repository
quantity
Int!
Total quantity including child repositories
ownQuantity
Int!
Quantity in this repository only
incomingStock
Int!
Pending incoming movements
ownIncomingStock
Int!
Incoming movements to this repository only
outgoingStock
Int!
Pending outgoing movements
ownOutgoingStock
Int!
Outgoing movements from this repository only
item
InventoryItem
The inventory item details
repository
Repository
The repository details
Usage Example
Notes
Available Stock can be calculated as:
quantity - outgoingStockProjected Stock can be calculated as:
quantity + incomingStock - outgoingStockThe
quantityfield includes stock in all child repositoriesUse
ownQuantitywhen you need stock at a specific location onlyVirtual repositories may have stock records but don't enforce validation
Last updated
Was this helpful?
