Skip to main content

Get Products

Query multiple products with filtering, sorting, and pagination.
query GetProducts {
  products(
    take: 20
    skip: 0
    orderBy: { createdAt: desc }
    where: { status: { equals: "published" } }
  ) {
    id
    title
    handle
    subtitle
    status
    isGiftcard
    thumbnail
    productType { id name }
    productCollection { id title }
    productCategory { id name }
    productTags { id value }
    createdAt
    updatedAt
  }
}

Response

products
array
Array of product objects

Get Single Product

Query a single product by ID or handle.
query GetProduct {
  product(where: { handle: "vintage-tee" }) {
    id
    title
    handle
    subtitle
    description
    status
    isGiftcard
    thumbnail
    discountable
    productImages {
      id
      imagePath
      image { url }
      sortOrder
    }
    productVariants {
      id
      title
      sku
      barcode
      inventoryQuantity
      allowBackorder
      manageInventory
      moneyAmounts {
        id
        amount
        currency { code }
        region { id name }
      }
      productOptions {
        id
        value
        option { id name }
      }
      measurements {
        id
        type
        value
        unit
      }
    }
    productOptions {
      id
      name
      values {
        id
        value
      }
    }
    productType {
      id
      name
    }
    productCollection {
      id
      title
      handle
    }
    productCategory {
      id
      name
      handle
    }
    productTags {
      id
      value
    }
  }
}

Filter Products

By Status

query PublishedProducts {
  products(where: { status: { equals: "published" } }) {
    id
    title
    status
  }
}

By Collection

query CollectionProducts {
  products(
    where: {
      productCollection: {
        handle: { equals: "summer-collection" }
      }
    }
  ) {
    id
    title
    productCollection { title }
  }
}

By Category

query CategoryProducts {
  products(
    where: {
      productCategory: {
        handle: { equals: "clothing" }
      }
    }
  ) {
    id
    title
    productCategory { name }
  }
}

By Tags

query TaggedProducts {
  products(
    where: {
      productTags: {
        some: {
          value: { equals: "new-arrival" }
        }
      }
    }
  ) {
    id
    title
    productTags { value }
  }
}

Search Products

query SearchProducts {
  products(
    where: {
      OR: [
        { title: { contains: "shirt", mode: insensitive } }
        { subtitle: { contains: "shirt", mode: insensitive } }
      ]
    }
  ) {
    id
    title
    subtitle
  }
}

Get Product Variants

Query variants for a specific product.
query GetProductVariants {
  productVariants(
    where: {
      product: { handle: { equals: "vintage-tee" } }
    }
  ) {
    id
    title
    sku
    barcode
    inventoryQuantity
    allowBackorder
    manageInventory
    moneyAmounts {
      amount
      currency { code }
      region { name }
    }
    productOptions {
      value
      option { name }
    }
    measurements {
      type
      value
      unit
    }
  }
}

Sorting Options

orderBy
object
Sort products by any fieldExamples:
  • { createdAt: desc } - Newest first
  • { title: asc } - Alphabetical
  • { updatedAt: desc } - Recently updated

Pagination

take
number
Number of products to return (default: 50)
skip
number
Number of products to skip (for pagination)

Virtual Fields

Openfront products include computed virtual fields:

thumbnail

Returns the URL of the first product image.
{
  product(where: { id: "..." }) {
    thumbnail
  }
}

dimensionsRange

Returns the min/max dimensions across all variants.
{
  product(where: { id: "..." }) {
    dimensionsRange
  }
}
Returns:
{
  "weight": { "min": 100, "max": 500, "unit": "g" },
  "length": { "min": 10, "max": 30, "unit": "cm" },
  "width": { "min": 5, "max": 15, "unit": "cm" },
  "height": { "min": 2, "max": 5, "unit": "cm" }
}

Access Control

Product queries are publicly accessible but filtered by status:
  • Unauthenticated users: Only see published products
  • Admin users: See all products regardless of status

Product Mutations

Create and update products

Product Models

Product data schema

Build docs developers (and LLMs) love