# Query into dynamic data using static key paths

**URL:** <https://forums.swift.org/t/query-into-dynamic-data-using-static-key-paths/36728>\
**Category:** Using Swift\
**Tags:** keypaths, dynamic, runtime, dynamicmemberlookup\
**Created:** [May 21, 2020, 4:01pm UTC](https://forums.swift.org/t/query-into-dynamic-data-using-static-key-paths/36728 "2020-05-21T16:01:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lightsprint09](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lightsprint09/32/6561_2.png) [@lightsprint09](https://forums.swift.org/u/lightsprint09)\
**Post date:** [May 22, 2020, 6:39am UTC](https://forums.swift.org/t/query-into-dynamic-data-using-static-key-paths/36728/4 "2020-05-22T06:39:20Z")

</div>

Ok. As far as I understand it, Runtime is the way to go?.

> [@Joe\_Groff](#):
>
> ...one thing you could do for stored keypaths is try to match the result of `MemoryLayout.offset(of: keyPath)` to the offsets of the fields in a struct, in order to map it to a property name that way.

@Joe_Groff Could you explain in a bit more detail what is necessary to achieve this ( Or give some general reference, where I can learn about the the swift runtime and how to access its meta information). I never queried into the runtime before.  
Will the result be just the last key path component or the whole (".stops[1].nights") key path.

---

_[View the full topic](https://forums.swift.org/t/query-into-dynamic-data-using-static-key-paths/36728)._
