# Apollo iOS 1.0 - Question about the purpose of some code

**URL:** <https://community.apollographql.com/t/apollo-ios-1-0-question-about-the-purpose-of-some-code/3689>\
**Category:** Client SDKs\
**Tags:** client, mobile, ios\
**Created:** [June 8, 2022, 8:06pm UTC](https://community.apollographql.com/t/apollo-ios-1-0-question-about-the-purpose-of-some-code/3689 "2022-06-08T20:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimisaacs](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jimisaacs/32/2483_2.png) [@jimisaacs](https://community.apollographql.com/u/jimisaacs)\
**Post date:** [June 8, 2022, 8:06pm UTC](https://community.apollographql.com/t/apollo-ios-1-0-question-about-the-purpose-of-some-code/3689/1 "2022-06-08T20:06:35Z")

</div>

So looking at the `DataDict` as maybe a 1:1 switch over from the mainline’s `resultMap`, I came across this: [Blaming apollo-ios/Sources/ApolloAPI/DataDict.swift at 11bc60df8fafeb3dfa52426beb0d8ca1b38f6d71 · apollographql/apollo-ios · GitHub](https://github.com/apollographql/apollo-ios/blame/11bc60df8fafeb3dfa52426beb0d8ca1b38f6d71/Sources/ApolloAPI/DataDict.swift#L16)

What is the purpose of this force cast? Can this be implemented to be more like `resultMap`? Is this only for testing?

---

<div class="post-metadata">

**Author:** ![AnthonyMDev](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/anthonymdev/32/5972_2.png) [@AnthonyMDev](https://community.apollographql.com/u/AnthonyMDev)\
**Post date:** [June 8, 2022, 9:24pm UTC](https://community.apollographql.com/t/apollo-ios-1-0-question-about-the-purpose-of-some-code/3689/2 "2022-06-08T21:24:39Z")

</div>

You shouldn’t really be accessing the `DataDict` directly. It is consumed by your generated models. These subscripts are called for accessing the fields on your generated model objects. And when you call one of those fields, we can guarantee that it is present and of the correct type (else the response data would have failed GraphQL validation in the first place). The force cast is because we already know and can guarantee the type is correct when being used proper (ie. from the generated field accessors on your generated `SelectionSet`s).

---

<div class="post-metadata">

**Author:** ![jimisaacs](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jimisaacs/32/2483_2.png) [@jimisaacs](https://community.apollographql.com/u/jimisaacs)\
**Post date:** [June 8, 2022, 11:40pm UTC](https://community.apollographql.com/t/apollo-ios-1-0-question-about-the-purpose-of-some-code/3689/3 "2022-06-08T23:40:13Z")

</div>

Thank you. As mentioned in another thread, we have already removed our use of resultMap, but you have definitely satisfied my curiousities.
