Skip to content

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.

Note: The translation field returns content for the locale specified in the request header. If a translation does not exist for the selected locale, the content will automatically fall back to the store's default language.

Arguments ​

ArgumentTypeRequiredDescription
firstInt❌ NoNumber of results to return (forward pagination).
afterString❌ NoCursor for forward pagination. Use with first.
lastInt❌ NoNumber of results for backward pagination.
beforeString❌ NoCursor for backward pagination. Use with last.

Possible Returns ​

Page Fields ​

FieldTypeDescription
idID!IRI-style unique identifier (e.g. /api/shop/pages/1).
_idInt!Numeric database ID.
layoutStringPage layout template name (e.g. default).
createdAtDateTime!Timestamp when the page was created.
updatedAtDateTime!Timestamp when the page was last updated.
translationPageTranslationActive locale translation for this page.

PageTranslation Fields ​

FieldTypeDescription
idID!IRI-style ID of the translation record.
_idInt!Numeric translation record ID.
pageTitleString!Display title of the CMS page.
urlKeyString!URL slug used to access the page (e.g. about-us).
htmlContentStringFull HTML body content of the page.
metaTitleStringSEO meta title tag.
metaDescriptionStringSEO meta description tag.
metaKeywordsStringSEO meta keywords.
localeString!Locale code for this translation (e.g. en, fr).

Use Cases ​

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.

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 ​

  1. Use urlKey for routing — Build page URLs using urlKey rather than the numeric _id for human-readable and SEO-friendly URLs
  2. Cache responses — CMS pages change infrequently; cache the response at the CDN or application level to reduce API calls
  3. Sanitize htmlContent — Always sanitize the htmlContent field before rendering to prevent XSS vulnerabilities
  4. Use translations — Always read content from the translation object to ensure locale-aware display
  5. Paginate for large stores — Even though CMS pages are typically few, use first to limit payload size

Released under the MIT License.