Skip to content

Categories

About

The categories query retrieves the complete list of product categories with full details including translations, media assets, and hierarchy information. Use this query to:

  • Build category navigation menus and sidebars
  • Display breadcrumb paths for product browsing
  • Implement category-based product filtering
  • Create category landing pages and collections
  • Sync category structure with external systems
  • Display category metadata (images, descriptions, logos, banners)
  • Support multi-language category content
  • Show category hierarchy with children counts

This query supports full pagination with cursor-based navigation and includes complete SEO metadata and display settings for each category.

Arguments

ArgumentTypeRequiredDescription
firstInt❌ NoNumber of categories to return (forward pagination). Max: 100.
afterString❌ NoPagination cursor for forward navigation. Use with first.
lastInt❌ NoNumber of categories for backward pagination. Max: 100.
beforeString❌ NoPagination cursor for backward navigation. Use with last.

Possible Returns

FieldTypeDescription
idID!Unique category API identifier.
_idInt!Numeric category ID.
positionIntDisplay position among siblings.
logoPathStringFile path to category logo.
logoUrlStringFull URL to category logo image.
bannerPathStringFile path to category banner.
bannerUrlStringFull URL to category banner image.
statusIntCategory status (0 = inactive, 1 = active).
displayModeStringDisplay mode: products_only, category_and_products, products_and_description.
_lftIntLeft value for nested set tree structure.
_rgtIntRight value for nested set tree structure.
additionalStringAdditional metadata (JSON format).
translationCategoryTranslation!Default locale translation.
translation.idID!Translation identifier.
translation._idInt!Numeric translation ID.
translation.categoryIdInt!Associated category ID.
translation.nameString!Category name in current language.
translation.slugString!URL slug for the category.
translation.urlPathString!Full URL path including hierarchy.
translation.descriptionStringCategory description text.
translation.metaTitleStringSEO meta title tag.
translation.metaDescriptionStringSEO meta description.
translation.metaKeywordsStringSEO keywords.
translation.localeIdIntLocale identifier.
translation.localeString!Language locale code (e.g., 'en', 'ar', 'fr').
translationsCategoryTranslationCollection!All available translations.
translations.edges[Edge!]!Translation edges with cursors.
translations.pageInfoPageInfo!Pagination info for translations.
translations.totalCountInt!Total translations for this category.
createdAtDateTime!Category creation timestamp.
updatedAtDateTime!Last update timestamp.
urlStringFull category URL.
childrenCategoryCollection!Child categories.
children.edges[Edge!]!Child category edges.
children.totalCountInt!Total child categories.
pageInfoPageInfo!Pagination information.
pageInfo.hasNextPageBoolean!Whether more pages exist forward.
pageInfo.hasPreviousPageBoolean!Whether more pages exist backward.
pageInfo.startCursorStringCursor for first item in page.
pageInfo.endCursorStringCursor for last item in page.
totalCountInt!Total categories matching filters.

Use Cases

1. Main Navigation Menu

Use the "Optimized for Navigation" example for rendering dropdown category menus.

2. Multi-Language Support

Use the "With All Translations" example to display categories in multiple languages.

3. Category Listing Page

Use the "Complete Details" example for full category information with images.

4. Pagination

Use the "With Cursor Pagination" example for handling large category lists.

Best Practices

  1. Request Only Needed Fields - Minimize data transfer by selecting only required fields
  2. Use Pagination - Always use pagination for better performance with many categories
  3. Cache Results - Categories change infrequently, cache the full list
  4. Filter by Status - Only fetch active categories by default
  5. Include SEO Data - Always fetch meta tags for search engine optimization
  6. Use Translations - Fetch translations for multi-language support

Released under the MIT License.