Skip to main content

Store Products

ListStoreProducts Query

This query retrieves a list of products for a specific store with comprehensive filtering, pagination, and sorting capabilities. It provides detailed information about each product including variants, pricing, inventory, media, and metadata.

Parameters​

  • $connection: ProductsConnectionInput - Pagination and sorting parameters:
    • first: Number of items to retrieve (e.g., 20)
    • offset: Starting position in the result set
    • sortBy: Field to sort by (e.g., "createdAt", "title", "updatedAt")
    • sortOrder: Order direction ("asc" or "desc")
  • $filter: ProductsFilterInput - Filter criteria for narrowing results:
    • isArchived: Filter by archive status (boolean)
    • isDeleted: Filter by deletion status (boolean)
    • isVisible: Filter by visibility status (boolean)
    • status: Filter by product status ("ACTIVE", "DRAFT", etc.)
    • storeIds: Array of store IDs to filter by
    • type: Filter by product type ("SIMPLE", "VARIABLE", etc.)
    • source: Filter by product source ("MANUAL", "IMPORT", etc.)
    • minPrice/maxPrice: Price range filtering
    • title: Text search in product titles
    • productIds: Filter by specific product IDs
  • $locale: String - Language locale for localized content (e.g., "en", "ar")

Response Structure​

The query returns a products object with:

  • totalCount - Total number of products matching the filter criteria
  • nodes - Array of product objects containing detailed product information
  • pageInfo - Pagination information with cursor-based navigation
  • __typename - GraphQL type information ("ProductConnection")

Product Fields Detail​

Each product in the nodes array includes:

Basic Information​

  • id - Unique product identifier
  • title - Product name/title
  • handle - URL-friendly product slug
  • type - Product type (SIMPLE, VARIABLE, etc.)
  • status - Product status (ACTIVE, DRAFT, ARCHIVED)
  • source - How the product was created (MANUAL, IMPORT, etc.)
  • isVisible - Whether product is visible in storefront
  • isArchived - Whether product is archived
  • isDeleted - Whether product is deleted
  • locale - Primary language locale
  • shortDescription - Brief product description
  • descriptionHtml - Full HTML description
  • taxable - Whether product is subject to tax
  • productTax - Tax rate if applicable
  • createdAt/updatedAt - Timestamps

Media and SEO​

  • media - Array of product images with full image details
  • seo - SEO metadata including title and description

Product Options and Attributes​

  • options - Product options (size, color, etc.) with values
  • attributes - Product attributes for categorization
  • collectionIds - Collections this product belongs to

Variants​

  • variants - Array of product variants containing:
    • Pricing information (price, compareAtPrice, cost)
    • Inventory details (quantity, trackQuantity)
    • SKU and external ID
    • Selected options and values
    • Cart limits and package details
    • Reservations and availability

Use Cases​

This query is ideal for:

  1. Product Catalog Display - Showing products in store listings
  2. Inventory Management - Managing product stock and variants
  3. Search and Filtering - Implementing product search functionality
  4. Admin Dashboards - Displaying product management interfaces
  5. Export Operations - Bulk product data retrieval
  6. Analytics - Product performance and catalog analysis

Example Filters​

Active Products Only​

{
"filter": {
"status": "ACTIVE",
"isVisible": true,
"isArchived": false,
"isDeleted": false
}
}

Products by Price Range​

{
"filter": {
"minPrice": 10.00,
"maxPrice": 100.00,
"status": "ACTIVE"
}
}

Search by Title​

{
"filter": {
"title": "shirt",
"isVisible": true
}
}

Recently Created Products​

{
"connection": {
"first": 10,
"sortBy": "createdAt",
"sortOrder": "desc"
},
"filter": {
"status": "ACTIVE"
}
}

Performance Notes​

  • Use pagination (first/offset) to limit response size
  • Apply specific filters to reduce query complexity
  • Consider using productIds filter when fetching specific products
  • The query includes comprehensive product data - consider requesting only needed fields for better performance
  • product(id: ID!) - Fetch a single product by ID
  • productVariants - Query product variants specifically
  • collections - Query product collections
  • productAttributes - Query available product attributes

GraphQL Endpoint​

https://graphql.wuilt.com

Operation: ListStoreProducts​

Try It Out​

Query​

query ListStoreProducts(
$connection: ProductsConnectionInput
$filter: ProductsFilterInput
$locale: String
) {
products(connection: $connection, filter: $filter, locale: $locale) {
totalCount
nodes {
id
title
handle
type
status
source
isVisible
isArchived
locale
shortDescription
descriptionHtml
taxable
productTax
createdAt
updatedAt
images {
...Image
__typename
}
seo {
title
description
__typename
}
options {
id
name
position
values {
id
name
__typename
}
__typename
}
attributes {
id
name
type
values {
id
name
__typename
}
__typename
}
collections {
nodes {
id
title
__typename
}
totalCount
__typename
}
variants(first: 50) {
nodes {
id
title
sku
price {
...Money
__typename
}
compareAtPrice {
...Money
__typename
}
cost {
...Money
__typename
}
quantity
trackQuantity
selectedOptions {
option {
id
name
__typename
}
value {
id
name
__typename
}
__typename
}
externalId
cartLimitsEnabled
minPerCart
maxPerCart
packageDetails {
weight
dimensions {
length
width
height
__typename
}
__typename
}
createdAt
updatedAt
__typename
}
__typename
}
__typename
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
__typename
}
__typename
}
}

fragment Money on Money {
amount
currencyCode
__typename
}

fragment Image on Image {
id
src
altText
width
height
__typename
}

Query Variables

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Note: Make sure to change the storeId with your store ID. For guidance on how to get your store ID, reference the Store ID guide.

Authentication​

To use this query, you will need an API key. Click the "API Key" button in the navigation bar to enter your credentials.