# Preload query access to resolved ref in TanStack Router

**URL:** <https://community.apollographql.com/t/preload-query-access-to-resolved-ref-in-tanstack-router/7735>\
**Category:** Client SDKs\
**Tags:** client, web, router\
**Created:** [August 2, 2024, 1:56pm UTC](https://community.apollographql.com/t/preload-query-access-to-resolved-ref-in-tanstack-router/7735 "2024-08-02T13:56:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericchernuka](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/ericchernuka/32/5224_2.png) [@ericchernuka](https://community.apollographql.com/u/ericchernuka)\
**Post date:** [August 2, 2024, 1:56pm UTC](https://community.apollographql.com/t/preload-query-access-to-resolved-ref-in-tanstack-router/7735/1 "2024-08-02T13:56:18Z")

</div>

I’m looking to handle setting a page title from data fetched from the loader in TanStack Router much like how it’s done in this [repo](https://github.com/benweier/wayfarer/blob/main/src/routes/fleet/ship/ship-route.meta.ts) which is leveraging React Query.

I’m wondering if there’s a method to read the resolved preload query ref outside of React hooks so that I can put title handling at the route level rather than inside component code?

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [August 2, 2024, 2:38pm UTC](https://community.apollographql.com/t/preload-query-access-to-resolved-ref-in-tanstack-router/7735/2 "2024-08-02T14:38:39Z")

</div>

No, at the time that’s not possible. That said, after the ref promise is resolved, that value will be in the cache, so you can use something like `client.cache.readQuery` to just read it out of the cache.

---

<div class="post-metadata">

**Author:** ![ericchernuka](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/ericchernuka/32/5224_2.png) [@ericchernuka](https://community.apollographql.com/u/ericchernuka)\
**Post date:** [August 2, 2024, 3:16pm UTC](https://community.apollographql.com/t/preload-query-access-to-resolved-ref-in-tanstack-router/7735/3 "2024-08-02T15:16:30Z")

</div>

Ah that could work! Thanks for the suggestion!
