Start a conversation

Moving an Article in a Chapter to any Guide

To move an article under a chapter to any guide in a KB board, use the moveChapterArticleToGuide 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
destinationGuideId Guide ID where you want to move the article Required
beforeContent The content ID (ID of the article under a guide) 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 guide 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",
            ...
            "contents": {
              "edges": [
                {
                  "node": {
                    "__typename": "Chapter",
                    "id": "chapter:154",
                    "title": "Qualities of AI",
                    "description": "test description",
                    "articles": {
                      "edges": [
                        {
                          "node": {
                            "id": "message:11941",
                            "uid": 11941
                          }
                        },
                        {
                          "node": {
                            "id": "message:11885",
                            "uid": 11885
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        },
        ...
        {
          "node": {
            "id": "guide:600",
            "title": "Nature of the Humans with regard to AI",
            "description": "The experts predicted networked artificial intelligence will amplify human effectiveness but also threaten human autonomy, agency and capabilities.",
            "hidden": true,
            "node": {
              "id": "board:AIBoard",
              "position": 897
            },
            "contents": {
              "edges": [
                {
                  "node": {
                    "__typename": "Chapter",
                    "id": "chapter:156",
                    "title": "QUALITIES OF AI ACCORDING TO EXPERTS",
                    "description": "Test Qualities",
                    "articles": {
                      "edges": []
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}

To move the article (UID: 11941) under a chapter (ID: 154) of a guide (ID: 598) to a guide (ID: 600), use the moveChapterArticleToGuide mutation.

mutation {
  moveChapterArticleToGuide(articleId: "message:11941", chapterId: "chapter:154", destinationGuideId: "guide:600") {
    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": {
    "moveChapterArticleToGuide": {
      "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",
            "description": "Artificial intelligence (AI) is the theory and development of computer systems capable of performing tasks that historically required human intelligence, such as recognizing speech, making decisions, and identifying patterns. AI is an umbrella term that encompasses a wide variety of technologies, including machine learning, deep learning, and natural language processing (NLP).",
            "hidden": false,
            "node": {
              "id": "board:AIBoard",
              "position": 897
            },
            "contents": {
              "pageInfo": {
                "hasNextPage": true,
                "endCursor": "MHwxNTR8MXwyOzJ8aWU6ZXF8",
                "startCursor": null,
                "hasPreviousPage": false
              },
              ...
              "edges": [
                {
                  "node": {
                    "__typename": "Chapter",
                    "id": "chapter:154",
                    "title": "Qualities of AI",
                    "description": "test description",
                    "articles": {
                      "edges": [
                        {
                          "node": {
                            "id": "message:11885",
                            "uid": 11885
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        },
        ...
        {
          "node": {
            "id": "guide:600",
            "title": "Nature of the Humans with regard to AI",
            ...
            "edges": [
              {
                "node": {
                  "__typename": "Chapter",
                  "id": "chapter:156",
                  "title": "QUALITIES OF AI ACCORDING TO EXPERTS",
                  "description": "Test Qualities",
                  "articles": {
                    "edges": []
                  }
                }
              },
              {
                "node": {
                  "__typename": "KBArticle",
                  "id": "content:163",
                  "message": {
                    "id": "message:11941",
                    "uid": 11941,
                    "body": "<P>KB with replies</P>"
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments