Tree Traversal in Strapi

Hello,

I am wondering if Strapi has a quick and easy way to learn something about trees constructed through relations.

Let’s say I have content types that all relate to each other like this:

                    Type A
                /              \
           Type B              Type B
         /         \         /         \
   Type C        Type C     Type C   Type C

etc…

I see in my example sqlite database has through tables relating content, i.e.,

type_A_type_B_links
type_B_type_C_links

What I’m curious about is if there is an easy-ish way in Strapi to, given a Type C item, can I figure out what Type A item is at the root of the tree?

1 Like