CMS Pages
About
The pages query retrieves a collection of all CMS (Content Management System) pages from your Bagisto store. Use this query to:
- List all static content pages (e.g. About Us, Privacy Policy, FAQ)
- Render CMS page listings in the storefront footer or navigation
- Build a sitemap of all content pages
- Access locale-specific page titles, slugs, and HTML content
- Retrieve SEO metadata (meta title, description, keywords) for each page
- Support multi-language storefronts with locale-aware translation data
This query returns all pages with their active locale translation. Use the page(id:) query to fetch a single page by ID.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
first | Int | ❌ No | Number of results to return (forward pagination). |
after | String | ❌ No | Cursor for forward pagination. Use with first. |
last | Int | ❌ No | Number of results for backward pagination. |
before | String | ❌ No | Cursor for backward pagination. Use with last. |
Possible Returns
Page Fields
| Field | Type | Description |
|---|---|---|
id | ID! | IRI-style unique identifier (e.g. /api/shop/pages/1). |
_id | Int! | Numeric database ID. |
layout | String | Page layout template name (e.g. default). |
createdAt | DateTime! | Timestamp when the page was created. |
updatedAt | DateTime! | Timestamp when the page was last updated. |
translation | PageTranslation | Active locale translation for this page. |
PageTranslation Fields
| Field | Type | Description |
|---|---|---|
id | ID! | IRI-style ID of the translation record. |
_id | Int! | Numeric translation record ID. |
pageTitle | String! | Display title of the CMS page. |
urlKey | String! | URL slug used to access the page (e.g. about-us). |
htmlContent | String | Full HTML body content of the page. |
metaTitle | String | SEO meta title tag. |
metaDescription | String | SEO meta description tag. |
metaKeywords | String | SEO meta keywords. |
locale | String! | Locale code for this translation (e.g. en, fr). |
Use Cases
1. Footer Navigation Links
Fetch all CMS pages and use urlKey and pageTitle to build footer navigation links dynamically.
2. CMS Page Sitemap
Retrieve all pages to generate a sitemap or page index for SEO crawlers.
3. Legal Pages Listing
Filter the result client-side to display legal pages such as Privacy Policy and Terms & Conditions.
4. Multi-language Storefront
Use the locale field in translation to display locale-aware page titles and content.
5. Admin Content Overview
List all CMS pages in an admin dashboard for quick access and management.
Best Practices
- Use
urlKeyfor routing — Build page URLs usingurlKeyrather than the numeric_idfor human-readable and SEO-friendly URLs - Cache responses — CMS pages change infrequently; cache the response at the CDN or application level to reduce API calls
- Sanitize
htmlContent— Always sanitize thehtmlContentfield before rendering to prevent XSS vulnerabilities - Use translations — Always read content from the
translationobject to ensure locale-aware display - Paginate for large stores — Even though CMS pages are typically few, use
firstto limit payload size
Related Resources
- Get Single CMS Page - Query a single page by ID
- Theme Customisations - Query storefront theme customisations
- Pagination Guide - Cursor pagination documentation
- Shop API Overview - Overview of Shop API resources

