To move an article under a chapter to any chapter in the KB board, use the moveChapterArticleToChapter
mutation.
Fields
Use the below fields to move an article in the KB board.
Field | Description | Required |
---|---|---|
articleId | ID of the article that you want to move | Required |
chapterId | The chapter ID of the article | Required |
destinationChapterId | Chapter ID where you want to move the articles | Required |
beforeArticle | The article ID before which the current article should be placed. If this field is not provided, the article will be moved to the last position in the destination chapter | Optional |
Example
Use the fetch KB guides Information to fetch and identify the guide ID, chapter ID, article ID, and content ID.
{
"data": {
"guides": {
"totalCount": 4,
"pageInfo": {
"hasNextPage": false,
"endCursor": null,
"startCursor": null,
"hasPreviousPage": false
},
"edges": [
{
"node": {
"id": "guide:598",
"title": "Artificial Intelligence",
.....
"edges": [
{
"node": {
"__typename": "Chapter",
"id": "chapter:153",
"title": "Qualities of Artificial Intelligence",
"description": "4 qualities of AI",
"articles": {
"edges": [
{
"node": {
"id": "message:11799",
"uid": 11799
}
},
{
"node": {
"id": "message:11905",
"uid": 11905
}
}
]
}
}
},
{
"node": {
"__typename": "Chapter",
"id": "chapter:154",
"title": "Qualities of AI",
"description": "Qualities as per experts",
"articles": {
"edges": [
{
"node": {
"id": "message:11885",
"uid": 11885
}
}
]
}
}
}
]
}
},
.....
]
}
}
}
To move the article (UID: 11885) under a chapter (ID: 154) to a chapter (ID: 153) before article (UID: 11905), use the moveChapterArticleToChapter
mutation.
mutation {
moveChapterArticleToChapter(
articleId: "article:11885",
chapterId: "chapter:154",
destinationChapterId: "chapter:153",
beforeArticle: "article:11905"
) {
errors {
__typename
... on PermissionDeniedError {
fields
message
}
... on UnsupportedConversationStyleError {
fields
message
}
... on GuideNotEnabledError {
fields
message
}
... on InvalidGuideError {
fields
message
}
... on InvalidChapterError {
fields
message
}
... on InvalidArticleError {
fields
message
}
... on InvalidContentError {
fields
message
}
... on DuplicateKBArticleError {
fields
message
}
... on InvalidPositionSpecifiedError {
fields
message
}
}
}
}
GraphQL response:
{
"data": {
"moveChapterArticleToChapter": {
"errors": null
}
}
}
Use the fetch KB guides Information to check for a successful move operation.
{
"data": {
"guides": {
"totalCount": 4,
"pageInfo": {
"hasNextPage": false,
"endCursor": null,
"startCursor": null,
"hasPreviousPage": false
},
"edges": [
{
"node": {
"id": "guide:598",
"title": "Artificial Intelligence",
...
"edges": [
{
"node": {
"__typename": "Chapter",
"id": "chapter:153",
"title": "Qualities of Artificial Intelligence",
"description": "4 qualities of AI",
"articles": {
"edges": [
{
"node": {
"id": "message:11799",
"uid": 11799
}
},
{
"node": {
"id": "message:11885",
"uid": 11885
}
},
{
"node": {
"id": "message:11905",
"uid": 11905
}
}
]
}
}
},
{
"node": {
"__typename": "Chapter",
"id": "chapter:154",
"title": "Qualities of AI",
"description": "Qualities as per experts.",
"articles": {
...
}
}
}
]
}
}
]
}
}
}
ATLAS
Comments