To fetch the previous and next article of a particular article in a guide, use the guideArticle
query.
Guide Article Constraints
Constraints to fetch the articles positions are given below:
Fields | Description | Required |
---|---|---|
messageID | ID of the article | Required |
guideID | The parent guide ID of the article | Optional |
contextNode | This field searches for an article’s associated guide within a specified context. If the guide is not found within the context node, it then searches outside the context node. | Optional |
Example
You can identify the article ID and guide ID for which you want to know the previous and next article using the fetch KB guides information.
To fetch the previous and next articles of an article (UID: 10412) under the guide (ID: 601), use the guideArticle
constraints.
GraphQL Query
query{
guideArticle (
messageId: "message:10412",
guideId: "guide:601",
contextNode:"board:AIBoard"
) {
previousGuideArticle {
subject
id
}
nextGuideArticle {
subject
id
}
article {
__typename
... on ChapterArticle {
chapter {
id
title
articles {
edges {
node {
subject
id
}
}
}
}
}
... on GuideArticle {
guide {
id
title
}
message {
id
subject
}
}
}
}
}
GraphQL Query Response
{
"data": {
"guideArticle": {
"previousGuideArticle": null,
"nextGuideArticle": {
"subject": "draft one",
"id": "message:11927"
},
"article": {
"__typename": "GuideArticle",
"guide": {
"id": "guide:601",
"title": "Opinion of Different Companies"
},
"message": {
"id": "message:10412",
"subject": "Test Automation"
}
}
}
}
}
ATLAS
Comments