Skip to main content

UpdateComment

Updates the body and/or asset of an existing comment. The results of this mutation can be affected by providing an authToken header to set a user for the operation.

UpdateComment(
id: ID!
body: String
asset: String
assetFileName: String
commentableType: String
): Comment

Arguments

UpdateComment.id ● ID! non-null scalar

The ID of the comment.

UpdateComment.body ● String scalar

The updated body of the comment.

UpdateComment.asset ● String scalar

The updated asset of the comment.

UpdateComment.assetFileName ● String scalar

The file name of the asset.

UpdateComment.commentableType ● String scalar

The type of the comment's parent thread to be updated, based on the thread's location, e.g. discussion board, assignment, widget thread, etc.

Type

Comment object

Examples

Run in Postman

Query:

UpdateComment(
$id: ID!,
$body: String,
$asset: String,
$assetFileName: String,
$commentableType: String
) {
UpdateComment(
id: $id,
body: $body,
asset: $asset,
assetFileName: $assetFileName,
commentableType: $commentableType
) {
id
commentable {
... on Topic {
...TopicFragment
}
... on Thread {
...ThreadFragment
}
}
commentableId
commentableType
body
user {
...UserFragment
}
parentComment {
...CommentFragment
}
createdAt
updatedAt
videoAsset
asset
assetFileName
notificationsEnabled
childComments {
...CommentsListFragment
}
userLikeId
likesCount
}
}

Variables:

{
"id": "58ccb96c-8e90-4464-86e0-f284442981df",
"body": "xyz789",
"asset": "abc123",
"assetFileName": "abc123",
"commentableType": "xyz789"
}

Response:

{
"data": {
"UpdateComment": {
"id": "58ccb96c-8e90-4464-86e0-f284442981df",
"commentable": "Topic",
"commentableId": "58ccb96c-8e90-4464-86e0-f284442981df",
"commentableType": "thread",
"body": "xyz789",
"user": "User",
"parentComment": "Comment",
"createdAt": "2024-06-20T16:58:58.782Z",
"updatedAt": "2023-12-20T16:58:58.782Z",
"videoAsset": "58ccb96c-8e90-4464-86e0-f284442981df",
"asset": "URL",
"assetFileName": "xyz789",
"notificationsEnabled": false,
"childComments": "CommentsList",
"userLikeId": "58ccb96c-8e90-4464-86e0-f284442981df",
"likesCount": 678
}
}
}