# More resilient code with data masking in Apollo Client 3.12

DevFeed: [More resilient code with data masking in Apollo Client 3.12](<https://devfeed.tech/articles/more-resilient-code-with-data-masking-in-apollo-client-3-12-23460.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/more-resilient-code-with-data-masking-in-apollo-client-3-12>)

Author: Jerel Miller

Published: 2024-12-10T09:47:59Z

Content type: release

Language: en

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

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

Tags: [3](<https://devfeed.tech/tags/3.md>), [apollo](<https://devfeed.tech/tags/apollo.md>), [apollo-client](<https://devfeed.tech/tags/apollo-client.md>), [data-masking](<https://devfeed.tech/tags/data-masking.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [performant](<https://devfeed.tech/tags/performant.md>), [query](<https://devfeed.tech/tags/query.md>), [react](<https://devfeed.tech/tags/react.md>), [render](<https://devfeed.tech/tags/render.md>)

## AI overview

Apollo Client 3.12 introduces data masking to expose each component only to fields requested by its query or fragment. This can prevent implicit dependencies: in the excerpt's example, a component breaks after another component removes a publish-date field that it had been relying on indirectly. Masking makes the missing data visible at the component boundary. It also encourages colocated GraphQL fragments, read with the useFragment hook; the source says components then re-render only when fields used by their fragment change. Enable masking with the option set to true on the Apollo Client instance. The supplied excerpt ends during the enablement explanation, so it does not establish further configuration details.

## Source excerpt

We are excited to announce the release of Apollo Client 3.12, which primarily focuses on data masking. When building complex applications today, Apollo Client users are leveraging GraphQL fragments to make their applications more maintainable. Data masking leverages fragments to help you write more resilient and performant code. What is data masking? Data masking enforces that only the fields requested by a component in a query or fragment are available to it.