Start a conversation

Moving a Guide Content to a Guide

To move an article or a chapter under a guide to any guide in a KB board, use the moveGuideContentToGuide mutation.

Fields

Use the below fields to move an article in any KB board.

Field Description Required
contentId Content ID (article ID or chapter ID) under a guide that you want to move Required
destinationGuideId Guide ID where you want to move the article Required
beforeContent The content ID before which the current article or chapter 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",
            ...
          }
        },
        {
          "node": {
            "__typename": "KBArticle",
            "id": "content:158",
            "message": {
              "id": "message:10412",
              "uid": 10412,
              "body": "<P>Lorem Ipsum Special Chars</P>\n<P>draft</P>"
            }
          }
        },
        {
          "node": {
            "__typename": "KBArticle",
            "id": "content:162",
            "message": {
              "id": "message:11807",
              "uid": 11807,
              "body": "<P>body draft</P>"
            }
          }
        },
        ...
        {
          "node": {
            "id": "guide:601",
            "title": "Opinion of Different Companies",
            ...
          }
        }
      ]
    }
  }
}

To move the article (UID: 10412 and content ID: 158) under a guide (ID: 598) to another guide (ID: 601), use the moveGuideContentToGuide mutation.

mutation {
  moveGuideContentToGuide(contentId: "content:158", destinationGuideId: "guide:601") {
    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": {
    "moveGuideContentToGuide": {
      "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:601",
            "title": "Opinion of Different Companies",
            "description": "This guide is about different companies",
            "hidden": false,
            "node": {
              "id": "board:AIBoard",
              "position": 897
            },
            "contents": {
              "pageInfo": {
                "hasNextPage": false,
                "endCursor": null,
                "startCursor": null,
                "hasPreviousPage": false
              },
              "edges": [
                {
                  "node": {
                    "__typename": "Chapter",
                    "id": "chapter:152",
                    "title": "tItle 5",
                    "description": "des",
                    "articles": {
                      "edges": []
                    }
                  }
                },
                {
                  "node": {
                    "__typename": "KBArticle",
                    "id": "content:161",
                    "message": {
                      "id": "message:11927",
                      "uid": 11927,
                      "body": "<P>draft body</P>"
                    }
                  }
                },
                {
                  "node": {
                    "__typename": "KBArticle",
                    "id": "content:158",
                    "message": {
                      "id": "message:10412",
                      "uid": 10412,
                      "body": "<P>Lorem Ipsum Special Chars</P>\n<P>draft</P>"
                    }
                  }
                }
              ]
            }
          }
        },
        ...
      ]
    }
  }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments