Start a conversation

Update a Blog Article

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
Update Blog Article Permissions
Update Blog Article Permissions

Basic Steps

  1. Open the blog board where you want to update a blog article.
  2. Identify the ID of the message from the blog board from the URL of the blog article.
  3. Ensure that you have the necessary permission to update the blog article granted by the Administrator based on your preference.
  4. 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.

  1. Sign in to your community.
  2. Go to the Knight Rider board.
  3. Make a note of the ID of the blog article which you want to update.
  4. Make sure that you have the required permission to update the blog article.
  5. 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"
                }
            }
        }
    }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments