# No data in linkResolver for RichText component

**URL:** <https://community.prismic.io/t/no-data-in-linkresolver-for-richtext-component/12488>\
**Category:** Developing with Prismic\
**Tags:** graphquery, gatsby, reactjs\
**Created:** [February 22, 2023, 11:58am UTC](https://community.prismic.io/t/no-data-in-linkresolver-for-richtext-component/12488 "2023-02-22T11:58:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricco.sobers](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@ricco.sobers](https://community.prismic.io/u/ricco.sobers)\
**Post date:** [February 22, 2023, 11:58am UTC](https://community.prismic.io/t/no-data-in-linkresolver-for-richtext-component/12488/1 "2023-02-22T11:58:03Z")

</div>

Hello I'm trying to use this following link structure in GatsbyJS.  
The page URL is created successfully - however when I link to the page within RichText the prefix is undefined.

This is my link resolver

```auto
if (properties.type === "page") {
    const { uid, data } = properties
    const prefix = data?.parent?.uid

    return `/${prefix}/${uid}/`
  }

```

This is my graphQuery in the gatsby-config plugin options

```auto
informational_page {
              silo_landing_page {
                ... on landing_page {
                  uid
                }
              }
            }

```

I've also been trying to do the same with a text field but no luck with getting this to work in a RichText component.

Thanks

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [February 22, 2023, 4:18pm UTC](https://community.prismic.io/t/no-data-in-linkresolver-for-richtext-component/12488/3 "2023-02-22T16:18:59Z")

</div>

Hello @ricco.sobers, Can you share the entire GraphQuery and the structure of the Custom Types?  
Where is the Content Relationship field located?

Also, Instead of the Link Resolver I'd recommend that you use a Route Resolver:

> **[Route Resolver](https://prismic.io/docs/route-resolver)**
>
> Learn what the Route Resolver is and how to use it in your project.
