Background
dotClient.page.get() switches between the Page REST API and GraphQL depending on the incoming params.
This causes two key pain points:
- Unpredictable response shapes – the same call can return different keys/types.
- Debug & performance overhead – engineers must inspect which endpoint fired, slowing troubleshooting and tuning.
For clarity and future‑proofing, we’ll route every page.get() call through GraphQL and return one stable object shape.
Task
Refactor dotClient.page.get() to always use GraphQL, no matter what params are passed. The method must consistently return to the same typed object:
const { pageAsset, navigation, content, params } = response;
Note:
The params object is the same that the method receive.
Proposed Objective
Same as Parent Issue
Proposed Priority
Priority 2 - Important
Acceptance Criteria
Acceptance Criteria
Pseudo-code:
async function getPage () {
const params = {
graphql: {
page: ``,
navigation: `navigation(path: '/', depth: 1) {
title,
href,
}`,
content: {
blog: `blogCollection('+contentType:BlogPosting') {
inode,
title,
body,
contentType,
publishDate,
tags,
categories,
}`
}
}
}
const response = await dotcms.page.getStable("/api/v1/content/title/test", params)
return response
}
Background
dotClient.page.get()switches between the Page REST API and GraphQL depending on the incoming params.This causes two key pain points:
For clarity and future‑proofing, we’ll route every
page.get()call through GraphQL and return one stable object shape.Task
Refactor
dotClient.page.get()to always use GraphQL, no matter what params are passed. The method must consistently return to the same typed object:Note:
The params
objectis the same that the method receive.Proposed Objective
Same as Parent Issue
Proposed Priority
Priority 2 - Important
Acceptance Criteria
Acceptance Criteria
<PageAssetBase<T>, PageAssetBase<T>, TContent>to override the default types.PageAssetBase<T>andPageAssetBase<T>that consumers can extend.const page = reponsePseudo-code: