Skip to main content

Store Collections

ListStoreCollections Query

This query retrieves a list of product collections for a specific store with comprehensive filtering, pagination, and sorting capabilities. It provides detailed information about each collection including metadata, SEO data, product counts, and associated images.

Parameters​

  • $connection: ProductCollectionConnectionInput - 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: ProductCollectionFilterInput - Filter criteria for narrowing results:
    • storeId: Store ID to filter collections by (required)
    • title: Text search in collection titles
    • isVisible: Filter by visibility status (boolean)
    • isArchived: Filter by archive status (boolean)
    • ids: Filter by specific collection IDs (array)
  • $locale: String - Language locale for localized content (e.g., "en", "ar")

Response Structure​

The query returns a ProductCollectionConnection object containing:

Connection Fields​

  • totalCount: Total number of collections matching the filter criteria
  • pageInfo: Pagination information with cursor-based navigation
  • nodes: Array of ProductCollection objects

Collection Fields​

Each collection in the nodes array includes:

Basic Information​

  • id: Unique collection identifier
  • title: Collection name/title
  • description: Plain text description
  • descriptionHtml: HTML-formatted description
  • shortDescription: Brief collection summary
  • handle: URL-friendly collection identifier

Media & SEO​

  • image: Featured collection image with dimensions and alt text
  • seo: SEO metadata including title and description

Metadata​

  • productsCount: Number of products in this collection
  • isVisible: Whether the collection is publicly visible
  • isArchived: Whether the collection is archived
  • locale: Current locale of the collection data
  • locales: Array of available locales for this collection
  • createdAt: Collection creation timestamp
  • updatedAt: Last modification timestamp

Use Cases​

  1. Store Collection Listing: Display all collections for a store's catalog
  2. Collection Management: Admin interface for managing collections
  3. Navigation Menus: Build category/collection navigation
  4. SEO Pages: Generate collection landing pages with proper metadata
  5. Analytics: Track collection performance and product counts

Example Usage​

This query is useful for:

  • Building collection browse pages
  • Creating collection-based navigation
  • Managing collection visibility and organization
  • Generating collection sitemaps
  • Building collection search and filtering interfaces

Notes​

  • Collections are containers that group related products together
  • Each collection can have its own SEO settings and featured image
  • Collections support localization for multi-language stores
  • The productsCount field provides quick access to collection size without querying products
  • Collections can be filtered by visibility and archive status for different use cases

GraphQL Endpoint​

https://graphql.wuilt.com

Operation: ListStoreCollections​

Try It Out​

Query​

query ListStoreCollections(
$connection: ProductCollectionConnectionInput
$filter: ProductCollectionFilterInput
$locale: String
) {
collections(connection: $connection, filter: $filter, locale: $locale) {
totalCount
nodes {
id
title
description
descriptionHtml
shortDescription
handle
image {
...Image
__typename
}
seo {
title
description
__typename
}
productsCount
isVisible
isArchived
locale
locales
createdAt
updatedAt
__typename
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
__typename
}
__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

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.