Add nested set field to You keystone project
https://en.wikipedia.org/wiki/Nested_set_model
In database fields: left
, rigth
, depth
left
: Intright
: Intdepth
: Intweight
: Int // Serial number through current branchparentId
: ID// Keystone id of direct parent elementisLeaf
: Boolean, true if have no childrenchildrenCount
// counts children
parentId
: type ID // Keystone id of direct parent elementchildOf
// filters all elements that are children of that Keystone idparentOf
// filters all elements that are parent of that Keystone idprevSiblingOf
: ID! // left sibling element, null if absentnextSiblingOf
: ID! // right sibling element, null if absent
parentId
: ID // Keystone id of direct parent elementprevSiblingId
: ID // Keystone id of left sibling elementnextSiblingId
: ID // Keystone id of right sibling element
If node has children they move to the parent of deleted node