Skip to main content

Single Product

The useProduct hook fetches a single product by its handle (the URL-friendly slug).

Usage

Hook API

Query Fields

The GET_PRODUCT query returns detailed product data:
  • Basic fields: id, title, handle, description, descriptionHtml
  • availableForSale, tags, productType, vendor
  • priceRange — min/max variant prices
  • images(first: 10) — all images with url, altText, width, height
  • variants(first: 20) — all variants with id, title, price, compareAtPrice, selectedOptions, image
  • options — product options with name and values
  • seo{ title, description }

Fetching by ID

If you only have a product’s Shopify GID, use the service method directly:

Adding to Cart

Combine with useCart() to add a variant:
See Cart & Checkout for details.