Skip to content

contentSnippet

Queryin Content

Get a specific content snippet by key. These snippets are reusable content blocks that can be used across different pages.

Arguments

ArgumentTypeDescription
versionContentVersionType
previewIdString
keyString!

Returns

ContentSnippet

FieldTypeDescription
idID!Unique identifier for the content snippet.
keyString!Key for identifying the content snippet.
content[Block!]Content for the snippet.

Example

query ContentSnippet(
$version: ContentVersionType
$previewId: String
$key: String!
) {
contentSnippet(version: $version, previewId: $previewId, key: $key) {
id
key
content {
__typename
... on RichText {
id
document
}
... on ArticleList {
id
anchor
audience
title
}
... on BrandList {
id
anchor
audience
title
}
}
}
}

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: