# Slice.primary.link type

**URL:** <https://community.prismic.io/t/slice-primary-link-type/12082>\
**Category:** Developing with Prismic\
**Tags:** typescript\
**Created:** [December 30, 2022, 3:53pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082 "2022-12-30T15:53:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emiliano.bucci](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@emiliano.bucci](https://community.prismic.io/u/emiliano.bucci)\
**Post date:** [December 30, 2022, 3:53pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082/1 "2022-12-30T15:53:00Z")

</div>

Hi! I'm currently trying the slicemachine specifically following this guide -\> [Create Navigation Menus with Next.js - Documentation - Prismic](https://prismic.io/docs/navigation-menus-nextjs) and i'm having some trouble with the types definition.

After creating the **navigation** slice and the **navigation items** i'm trying to access to the **uid** property of the **Link** field but it seems that the only available field is **slice.primary.link.link\_type** but not **slice.primary.link.uid** (they're available on the response but not in the type definition).

I've also added **./.slicemachine/prismicio.d.ts** in my **tsconfig.json** but still no luck; is there any way to add proper types?

Thanks!

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [January 3, 2023, 8:22pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082/3 "2023-01-03T20:22:18Z")

</div>

Hello Emiliano,

Welcome to the Prismic community, and thanks for reaching out to us.

The fields in a slice you can access come under the `data` property, and the UID comes under `results,` so you can not access the UID field. I would like to know more about your use case. Why do you want to access the UID field while creating navigation?

I am looking forward to hearing from you back.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![emiliano.bucci](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@emiliano.bucci](https://community.prismic.io/u/emiliano.bucci)\
**Post date:** [January 4, 2023, 4:26pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082/4 "2023-01-04T16:26:53Z")

</div>

Hi, and thanks for the answer! Maybe i didn't explain myself well:

 ![Screenshot 2023-01-04 at 17.24.53](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/1/1a7fe96fa439b478bbd6233b4f0cb6ae5f61798d.png)

As you can see here in the response, i have the link item, so i can get the **uid** like this:  
**item.primary.link.uid**

 ![Screenshot 2023-01-04 at 17.25.05](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/0/0b043456f486a3ab298d6f229ff8a31719c183ec.png)

but for some reason the type only allows to select the **link\_type** property

---

<div class="post-metadata">

**Author:** ![emiliano.bucci](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@emiliano.bucci](https://community.prismic.io/u/emiliano.bucci)\
**Post date:** [January 5, 2023, 2:39pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082/5 "2023-01-05T14:39:27Z")

</div>

Same thing happen for the Media link;

 ![Screenshot 2023-01-05 at 15.38.43](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/e/e048e45dd357b2080d49126c8fb61c6ca1e8385d.png)

As you can see from the screen, the api returns an object containing multiple properties, but types only target **link\_type**.

I guess in this case the right thing to do do is to use a function to narrow the type, right?

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [January 19, 2023, 1:29pm UTC](https://community.prismic.io/t/slice-primary-link-type/12082/6 "2023-01-19T13:29:21Z")

</div>

Hello @emiliano.bucci

Sorry for being delayed reply. That's true that You can access metadata under the link field except for link\_type. That's the expected behavior.

Thanks,  
Priyanka
