Single CMS Page
About
The page(id:) query retrieves a single CMS (Content Management System) page by its IRI-style ID. Use this query to:
- Render a specific CMS page (e.g. About Us, Privacy Policy) in the storefront
- Retrieve the full HTML content of a page for display
- Access SEO metadata (meta title, description, keywords) for a specific page
- Fetch locale-specific translation data for a page
- Build dynamic page routes using
urlKey - Validate whether a page exists before rendering
This query returns a single page with its active locale translation. Use the pages query to list all available pages.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | ✅ Yes | IRI-style identifier of the page (e.g. /api/shop/pages/1). |
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. Render a CMS Page
Fetch a specific page by ID and render its htmlContent on a dedicated page route in the storefront.
2. SEO Head Tags
Use metaTitle, metaDescription, and metaKeywords from the translation to populate <meta> tags dynamically.
3. Page Validation
Query a page before rendering to check whether it exists; handle null responses with a 404 page.
4. Multi-language Content
Use the locale field in translation to display locale-aware page content in multilingual storefronts.
5. Dynamic Page Routing
Use urlKey to implement client-side routing so users access pages via human-readable URLs (e.g. /about-us).
Best Practices
- Use the IRI format — Always pass the full IRI string (e.g.
/api/shop/pages/1) as theidargument - Handle null gracefully — If
pagereturnsnull, show a 404 response to the user - Sanitize
htmlContent— Always sanitize thehtmlContentfield before rendering to prevent XSS vulnerabilities - Cache individual pages — Cache page responses keyed by ID; invalidate the cache when content is updated
- Use
urlKeyfor routing — Build page URLs fromurlKeyfor SEO-friendly, human-readable links - Fetch only needed fields — Omit
htmlContentwhen only metadata (title, URL) is needed to reduce response size
Related Resources
- Get All CMS Pages - Query all CMS pages
- Theme Customisations - Query storefront theme customisations
- Pagination Guide - Cursor pagination documentation
- Shop API Overview - Overview of Shop API resources

