Simplified hooks
ReturnSimpleProduct objects with pre-computed prices and images.
| Name | Type | Purpose |
|---|---|---|
useProducts(storeUid, currency) | Hook | Fetch all products for a store |
useProduct(productUid) | Hook | Fetch a single product by UID |
fetchProducts(storeUid, currency) | Method | Server-side fetch of all products |
fetchProduct(productUid) | Method | Server-side fetch of a single product |
Full data hooks
Return the fullStoreProduct shape from the GraphQL API, including all variant, pricing, media, and deliverable data.
| Name | Type | Purpose |
|---|---|---|
useStoreProducts(storeUid) | Hook | Fetch all products for a store |
useStoreProduct(productUid) | Hook | Fetch a single product by UID |
fetchStoreProducts(storeUid) | Method | Server-side fetch of all products |
fetchStoreProduct(productUid) | Method | Server-side fetch of a single product |
Types
SimpleProduct
Returned byuseProducts, useProduct, fetchProducts, and fetchProduct.
StoreProduct
Returned byuseStoreProducts, useStoreProduct, fetchStoreProducts, and fetchStoreProduct. The full product shape from the GraphQL API.
Next steps
- Cart. Add products to the cart and manage line items
- Products concepts. Understand the product data model and pricing