From b4c81b44abf54cacfdbfd399cbbbd5239158b0ba Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 31 Mar 2021 00:50:26 -0600 Subject: [PATCH] Added a note --- framework/commerce/README.md | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/framework/commerce/README.md b/framework/commerce/README.md index 6f75f1798..5da76cba2 100644 --- a/framework/commerce/README.md +++ b/framework/commerce/README.md @@ -327,36 +327,7 @@ const WishlistButton = ({ productId, variant }) => { While commerce hooks focus on client side data fetching and interactions, the commerce API focuses on static content generation for pages and API endpoints in a Node.js context. -### getAllProducts - -API function to retrieve a product list. - -```js -import { getConfig } from '@bigcommerce/storefront-data-hooks/api' -import getAllProducts from '@bigcommerce/storefront-data-hooks/api/operations/get-all-products' - -const { products } = await getAllProducts({ - variables: { field: 'featuredProducts', first: 6 }, - config, - preview, -}) -``` - -### getProduct - -API product to retrieve a single product when provided with the product -slug string. - -```js -import { getConfig } from '@bigcommerce/storefront-data-hooks/api' -import getProduct from '@bigcommerce/storefront-data-hooks/api/operations/get-product' - -const { product } = await getProduct({ - variables: { slug }, - config, - preview, -}) -``` +> The commerce API is currently going through a refactor in https://github.com/vercel/commerce/pull/252 - We'll update the docs once the API is released. ## More