# \[Help\] Where to find relations when getting content item of type tree?

**URL:** <https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450>\
**Category:** Cockpit v2\
**Created:** [August 17, 2022, 5:49am UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450 "2022-08-17T05:49:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jamo/32/1117_2.png) [@Jamo](https://discourse.getcockpit.com/u/Jamo)\
**Post date:** [August 17, 2022, 5:49am UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450/1 "2022-08-17T05:49:00Z")

</div>

Hey there 😊

I’ve created a tree model to link all the pages I want to show in my navbar.  
I can easily get all the entries in said content item by making a GET request to

```http
COCKPIT_HOST/api/content/items/navbar

```

This gives me a result similar to this:

```json
[
    {
        "page": "pages://7fe0f08d313737efe2000188",
        "pagename": "Page 1",
        "_pid": null,
        "_o": 0,
        "_modified": 1660654033,
        "_mby": "7f6f355e303630fdc8000059",
        "_created": 1660650431,
        "_state": 1,
        "_cby": "7f6f355e303630fdc8000059",
        "_id": "80ca765738376179670000ad"
    },
    {
        "page": "pages://80b0ed4033376434f30002b6",
        "pagename": "Page 2",
        "_pid": null,
        "_o": 2,
        "_modified": 1660654054,
        "_mby": "7f6f355e303630fdc8000059",
        "_created": 1660650447,
        "_state": 1,
        "_cby": "7f6f355e303630fdc8000059",
        "_id": "80ccdc9b3866613e8c00027f"
    },
    { ... }
]

```

So far so good.

But what if Page 2 is set as a child of Page 1 in my tree structure? Where can I see this in the API’s response? I can’t see a `children`, or `parent` object that indicates that certain entries are linked in a relation.  
Am I using the wrong endpoint for this?

Thanks everyone ❤

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [August 17, 2022, 9:46am UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450/2 "2022-08-17T09:46:24Z")

</div>

`_pid` is the parent id.

---

<div class="post-metadata">

**Author:** ![Jamo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jamo/32/1117_2.png) [@Jamo](https://discourse.getcockpit.com/u/Jamo)\
**Post date:** [August 17, 2022, 9:51am UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450/3 "2022-08-17T09:51:55Z")

</div>

That was all I’ve been looking for. Things can be so easy sometimes … 😄  
Thanks a lot and have a great day ✌

---

<div class="post-metadata">

**Author:** ![filipmiik](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/filipmiik/32/1182_2.png) [@filipmiik](https://discourse.getcockpit.com/u/filipmiik)\
**Post date:** [October 22, 2022, 3:21pm UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450/4 "2022-10-22T15:21:05Z")

</div>

Hi,

is there a way to get this property with GraphQL? With the REST API endpoint, everything seems to be working fine and `_pid` and `_o` properties are present, but in GraphQL schema definition, those properties are missing, so they cannot be even queried.

Thanks

---

<div class="post-metadata">

**Author:** ![filipmiik](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/filipmiik/32/1182_2.png) [@filipmiik](https://discourse.getcockpit.com/u/filipmiik)\
**Post date:** [August 11, 2023, 10:37pm UTC](https://discourse.getcockpit.com/t/help-where-to-find-relations-when-getting-content-item-of-type-tree/2450/5 "2023-08-11T22:37:54Z")

</div>

Update: GraphQL API meta field inconsistency fixed by [https://github.com/Cockpit-HQ/Cockpit/pull/151](https://github.com/Cockpit-HQ/Cockpit/pull/151).
