You can update your own blog article or any blog article in a blog board that you want.
Requirements
You must have either one of the below permissions set to Grant by the Administrator based on your preference.
- Edit own published posts - To update your own blog article
- Edit any published post - To update any blog article
Basic Steps
- Open the blog board where you want to update a blog article.
- Identify the ID of the message from the blog board from the URL of the blog article.
- Ensure that you have the necessary permission to update the blog article granted by the Administrator based on your preference.
- Create a POST request to update a blog article.
Example
Update a Blog Article
In this example, we are going to update a blog article in the Knight Riders board using a GraphQL query.
After you have updated a blog message on the board, make sure you have received success as a response.
- Sign in to your community.
- Go to the Knight Rider board.
- Make a note of the ID of the blog article which you want to update.
- Make sure that you have the required permission to update the blog article.
- Make a GraphQL POST request to the board.
The ID of the Klass Forum Board is 403.
Here is the GraphQL POST request and response to update a blog article.
mutation updateBlogArticle($id:ID!, $updateInput:UpdateBlogArticleInput!) {
updateBlogArticle(id: $id, updateInput: $updateInput) {
result {
id
body
subject
contentWorkflow {
state
}
}
}
}
The mutation here initiates an updateBlogArticle
function using information passed through GraphQL variables. Here is an example to update a blog article.
{
"id": "message:403",
"updateInput": {
"subject": "A trip to my hometown native",
"body": "It's been long since I went to my native. This blog is about how I reached my native using my two-wheeler. A ride through lushy and dense reserved where I saw a lion."
}
}
Here is the response to the above example.
{
"data": {
"updateBlogArticle": {
"result": {
"id": "message:403",
"subject": "A trip to my hometown native",
"body": "It's been long since I went to my native. This blog is about how I reached my native using my two-wheeler. A ride through lushy and dense reserved where I saw a lion.",
"contentWorkflow": {
"state": "PUBLISH"
}
}
}
}
}
ATLAS
Comments