How to create or update a page override using the GraphQL API for Aurora.
To create or update one or more Page Descriptors via GraphQL, you'll need to make a GraphQL call to execute the createOrUpdateBulkPage
mutation. Behind the scenes, this mutation will create all the files needed to specify the properties that render your page overrides and check them into the Git repo for you.
Example
Here is an example GraphQL call, which includes the Query and the Variables to make the call:
Query
GraphQL createOrUpdateBulkPage mutation
mutation createOrUpdateBulkPage($pages: [PageDescriptorInput!]!) {
createOrUpdateBulkPage(pages: $pages) {
result {
lastUpdatedTime
page {
id
type
urlPath
}
}
errors {
... on CreateOrUpdatePageError {
... Error
}
}
}
}
fragment Error on Error {
message
fields
}
We are using the createOrUpdateBulkPage
mutation here to create three overrides to default page JSON files. The pages we are targeting are defined in the Variables. We are requesting a timestamp of the last updated time, as well as page IDs, types, and URLs for each page we are creating or updating.
In the event of an error, we're requesting the error message and any field(s) involved.
Variables
createOrUpdateBulkPage mutation variables
{
"pages":[
{
"id":"ForumBoardPage",
"type":"FORUM",
"urlPath":"/myforum/:boardId"
},
{
"id":"CommunityPage",
"type":"COMMUNITY",
"urlPath":"/mycommunity"
},
{
"id":"BlogBoardPage2",
"type":"BLOG",
"urlPath":"/myblog/:boardId"
}
]
}
Through the Variables we have defined three pages that we would like to create or update. This includes their id, type, and urlPath.
ATLAS
Comments