Documentation Center

Sample query: fetching a subtree of the table of contents

Use the ID of a node in the table of contents to fetch only nodes in the table of contents that are subordinate to that node.

The following sample fetches all nodes in the table of contents that are subordinate to the node with the ID t1-k5 (up to three levels down):
{
  ishToc(publicationId: 2778701) {
    title
    hasChildren
    entries(tocId:"t1-k5") {
      title
      tocId
      url
      hasChildren
      entries {
        title
        tocId
        url
        hasChildren
        entries {
          title
          tocId
          url
          hasChildren
        }
      }
    }
  }
}

Obviously, in order to find out that ID t1-k5, you must have first run an ishToc query in which entries either has no tocId set (which returns the entire table of contents), or has tocId set to the ID of a parent node of t1-k5.