Skip to main content
The inventory dashboard example loads a bounded sample of stock positions and exposes one function, inventory.facts, which allows role.anyone. The fixture loader inventory.load declares no allow, so it is internal. The positions table is keyed by SKU (key: ["sku"]), and onHand is a t.int, so counts beyond 2^53 keep their exact bigint value. The query reads ctx.list(positions.first(32)) and returns each position’s SKU, location and count. Read it with connect(url) and client.query(api<typeof App>().inventory.facts, {}), or watch it in React with useWatch(api<typeof App>().inventory.facts, {}).