# Mastering Cache Key Resolution in Apollo iOS with @typePolicy and @fieldPolicy

DevFeed: [Mastering Cache Key Resolution in Apollo iOS with @typePolicy and @fieldPolicy](<https://devfeed.tech/articles/mastering-cache-key-resolution-in-apollo-ios-with-typepolicy-and-fieldpolicy-23450.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/mastering-cache-key-resolution-in-apollo-ios-with-typepolicy-and-fieldpolicy>)

Author: Zach FettersMoore

Published: 2025-11-10T10:37:20Z

Content type: article

Language: en

Sources: [Apollo Blog](<https://devfeed.tech/sources/apollo-blog.md>)

Topics: [Cache](<https://devfeed.tech/topics/cache.md>), [apollo-client](<https://devfeed.tech/topics/apollo-client.md>)

Tags: [apollo](<https://devfeed.tech/tags/apollo.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [entries](<https://devfeed.tech/tags/entries.md>), [field](<https://devfeed.tech/tags/field.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [ios](<https://devfeed.tech/tags/ios.md>), [key](<https://devfeed.tech/tags/key.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [network](<https://devfeed.tech/tags/network.md>), [object](<https://devfeed.tech/tags/object.md>), [policies](<https://devfeed.tech/tags/policies.md>), [queries](<https://devfeed.tech/tags/queries.md>), [reading](<https://devfeed.tech/tags/reading.md>), [retrieval](<https://devfeed.tech/tags/retrieval.md>), [schema](<https://devfeed.tech/tags/schema.md>), [storage](<https://devfeed.tech/tags/storage.md>), [store](<https://devfeed.tech/tags/store.md>), [type](<https://devfeed.tech/tags/type.md>), [unique](<https://devfeed.tech/tags/unique.md>)

## AI overview

Apollo iOS normalizes nested GraphQL responses into a flat cache, identifying objects by cache keys. Its default response-path keys can store the same entity separately when it appears at different query paths. Type policies let writes use schema identifiers such as `id` to keep objects with the same identity in one cache entry; field policies can use query parameters to find matching cached objects on reads and may avoid a network request when they construct a key matching one established by a type policy. The excerpt explains these roles but does not include directive syntax or configuration details.

## Source excerpt

When working with Apollo iOS's normalized cache, one of the most critical decisions you'll make is how to identify and retrieve cached objects efficiently. The and directives provide a powerful declarative approach to cache key resolution, enabling your application to intelligently store and retrieve data while minimizing network requests and avoiding cache duplication. Overview: The Cache Key Resolution Problem Apollo iOS uses a normalized cache to store GraphQL responses.