In the UntypedContent - will not fetch the metadata info. It just holds the page output data, the fact that in the backend metadata is stored separately, and you need to use metadata { metadataField }
In Sites 9.6, instead of using UntypedContent you can publish using data-template-less headless publishing to use Semantic Content Model GraphiQL query.
Here is a sample graphiql query with metadata with the corresponding output.
{
page(namespaceId: 1, publicationId: 2, pageId: 231) {
publicationId
itemId
title
regions {
name
components {
itemId
title
... on FinanceArticle {
heading
subHeading
bodyText {
html
}
numberField
dateField
image {
... on Image {
title
metadata {
altText
}
variants {
edges {
node {
url
downloadUrl
}
}
}
}
}
metadata {
metadataField1
financeArticleType {
... on Keyword {
title
description
key
}
}
}
}
}
}
}
}
Here is the output:
{
"data": {
"page": {
"publicationId": 14,
"itemId": 719,
"title": "Finance Articles Page",
"regions": [
{
"name": "Main",
"components": [
{
"itemId": 718,
"title": "Finance Article Sample 1",
"heading": "Heading - Finance Article Sample 1",
"subHeading": "Subheading - Finance Article Sample 1",
"bodyText": {
"html": "<p>Body Text content in Finance Article Sample 1.</p>"
},
"numberField": 11,
"dateField": "2023-01-31T02:54:47.000",
"image": {
"title": "Finance Article Image 1",
"metadata": {
"altText": "Alt Text - Finance Article Image 1"
},
"variants": {
"edges": [
{
"node": {
"url": "/media/skyline.jpg",
"downloadUrl": "http://localhost:8081/cd/api/binary/1/14/717"
}
}
]
}
},
"metadata": {
"metadataField1": "Metadata value!",
"financeArticleType": {
"title": "Internal Report",
"description": "Internal Report",
"key": "InternalReport"
}
}
},
{
"itemId": 720,
"title": "Finance Article Sample 2",
"heading": "Heading - Finance Article Sample 2",
"subHeading": "Subheading - Finance Article Sample 2",
"bodyText": {
"html": "<p>Body Text content</p>\n<p>More content</p>"
},
"numberField": 1200,
"dateField": "2022-12-29T02:54:47.000",
"image": {
"title": "Finance Article Image 2",
"metadata": {
"altText": "Alt Text - Finance Article Image 2"
},
"variants": {
"edges": [
{
"node": {
"url": "/media/blueprint.jpg",
"downloadUrl": "http://localhost:8081/cd/api/binary/1/14/721"
}
}
]
}
},
"metadata": {
"metadataField1": "Metadata content",
"financeArticleType": {
"title": "End of Year Announcement",
"description": "End of Year Announcement",
"key": "EndOfYearResults"
}
}
}
]
}
]
}
}
}
I hope it helps.