Skip to main content

CreateThread

Creates a thread of comments under a commentable type. The results of this mutation can be affected by providing an authToken header to set a user for the operation.

CreateThread(
clientId: ID
forumId: ID!
courseId: ID
layoutId: ID
widgetTitle: String
commentableType: CommentableType
asset: URL
assetFileName: String
videoAsset: ID
body: String
title: String!
notificationsEnabled: Boolean!
): Thread

Arguments

CreateThread.clientId ● ID scalar

The ID of the client.

CreateThread.forumId ● ID! non-null scalar

The ID of the forum.

CreateThread.courseId ● ID scalar

The ID of the course.

CreateThread.layoutId ● ID scalar

The ID of the layout.

CreateThread.widgetTitle ● String scalar

The title of the widget.

CreateThread.commentableType ● CommentableType enum

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

CreateThread.asset ● URL scalar

The URL of the asset.

CreateThread.assetFileName ● String scalar

The file name of the asset.

CreateThread.videoAsset ● ID scalar

The ID of the video asset.

CreateThread.body ● String scalar

The body of the comment.

CreateThread.title ● String! non-null scalar

The title of the comment.

CreateThread.notificationsEnabled ● Boolean! non-null scalar

Flag to enable notifications.

Type

Thread object

Examples

Run in Postman

Query:

CreateThread(
$clientId: ID,
$forumId: ID!,
$courseId: ID,
$layoutId: ID,
$widgetTitle: String,
$commentableType: CommentableType,
$asset: URL,
$assetFileName: String,
$videoAsset: ID,
$body: String,
$title: String!,
$notificationsEnabled: Boolean!
) {
CreateThread(
clientId: $clientId,
forumId: $forumId,
courseId: $courseId,
layoutId: $layoutId,
widgetTitle: $widgetTitle,
commentableType: $commentableType,
asset: $asset,
assetFileName: $assetFileName,
videoAsset: $videoAsset,
body: $body,
title: $title,
notificationsEnabled: $notificationsEnabled
) {
id
course {
...CourseFragment
}
forum {
...ForumFragment
}
forumId
client {
...ClientFragment
}
createdAt
updatedAt
asset
assetFileName
videoAsset
title
body
commentsCount
user {
...UserFragment
}
notificationsEnabled
matchCount
bookmark
}
}

Variables:

{
"clientId": "58ccb96c-8e90-4464-86e0-f284442981df",
"forumId": "58ccb96c-8e90-4464-86e0-f284442981df",
"courseId": "58ccb96c-8e90-4464-86e0-f284442981df",
"layoutId": "58ccb96c-8e90-4464-86e0-f284442981df",
"widgetTitle": "abc123",
"commentableType": "thread",
"asset": "URL",
"assetFileName": "abc123",
"videoAsset": "58ccb96c-8e90-4464-86e0-f284442981df",
"body": "abc123",
"title": "abc123",
"notificationsEnabled": true
}

Response:

{
"data": {
"CreateThread": {
"id": "58ccb96c-8e90-4464-86e0-f284442981df",
"course": "course-1",
"forum": "Forum",
"forumId": "58ccb96c-8e90-4464-86e0-f284442981df",
"client": "client-1",
"createdAt": "2023-12-20T16:58:58.782Z",
"updatedAt": "2024-06-20T16:58:58.782Z",
"asset": "URL",
"assetFileName": "xyz789",
"videoAsset": "58ccb96c-8e90-4464-86e0-f284442981df",
"title": "abc123",
"body": "xyz789",
"commentsCount": 678,
"user": "User",
"notificationsEnabled": true,
"matchCount": 678,
"bookmark": "58ccb96c-8e90-4464-86e0-f284442981df"
}
}
}