Skip to content

contentPage

Queryin Content

Fetch a content page by path, e.g. an About Us or Terms & Conditions page. Its body is a list of blocks, so select the members of the Block union the project registers.

Arguments

ArgumentTypeDescription
versionContentVersionType
pathString!
previewIdString

Returns

ContentPage

FieldTypeDescription
idID!Unique identifier for the content page.
nameString!Name of the content page.
headingString!Text of the page's one top-level heading, which the page renders itself.
headingVisibleBoolean!False keeps the H1 for search engines and screen readers but hides it, for a page whose first block opens it, such as a home page with a campaign banner.
pathString!URL path of the content page.
translatedPaths[TranslatedPath!]List of translated paths for different locales.
breadcrumbs[Breadcrumb!]Breadcrumb trail for the content page.
metaPageMetaPage metadata for SEO and other purposes.
introStringThe text below the heading.
leadImageContentAssetThe image below the heading, with no text on it; also the card image in a list and the fallback for the SEO image.
body[Block]Main content body of the page, composed of various block types.
categories[ProductCategory!]!The product categories the page is about. A product shows the page among its articles when its primary category, or one of that category's ancestors, is among them.

Example

query ContentPage(
$version: ContentVersionType
$path: String!
$previewId: String
) {
contentPage(version: $version, path: $path, previewId: $previewId) {
id
name
heading
headingVisible
path
translatedPaths {
locale
path
}
breadcrumbs {
name
path
type
}
meta {
title
description
}
intro
leadImage {
alt
filename
name
isExternalUrl
title
}
body {
__typename
... on RichText {
id
document
}
... on ArticleList {
id
anchor
audience
title
}
... on BrandList {
id
anchor
audience
title
}
}
categories {
id
key
name
path
description
productCount
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Used by

The storefront packages that send it, in these GraphQL documents: