diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a7417c4bbc..3c2a2f1c0ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,11 @@ ### Minor Changes -- [#12124](https://github.com/apollographql/apollo-client/pull/12124) [`ab0a1b5`](https://github.com/apollographql/apollo-client/commit/ab0a1b587233410bddb0f9d180f0d5019c035af2) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Promote to 3.12.0-rc.0 +#### Data masking 🎭 -- [#12131](https://github.com/apollographql/apollo-client/pull/12131) [`21c3f08`](https://github.com/apollographql/apollo-client/commit/21c3f083013445707b7b50ae6390318bc568d0f5) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Allow `null` as a valid `from` value in `useFragment`. +- [#12042](https://github.com/apollographql/apollo-client/pull/12042) [`1c0ecbf`](https://github.com/apollographql/apollo-client/commit/1c0ecbf3c0454056853dd3dcb493dfd5fa1a96b1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Introduces data masking in Apollo Client. -- [#12042](https://github.com/apollographql/apollo-client/pull/12042) [`1c0ecbf`](https://github.com/apollographql/apollo-client/commit/1c0ecbf3c0454056853dd3dcb493dfd5fa1a96b1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Introduces data masking into Apollo Client. Data masking allows components to access only the data they asked for through GraphQL fragments. This prevents coupling between components that might otherwise implicitly rely on fields not requested by the component. Data masking also provides the benefit that masked fields only rerender components that ask for the field. + Data masking enforces that only the fields requested by the query or fragment is available to that component. Data masking is best paired with [colocated fragments](https://www.apollographql.com/docs/react/data/fragments#colocating-fragments). To enable data masking in Apollo Client, set the `dataMasking` option to `true`. @@ -19,29 +19,12 @@ }); ``` - You can selectively disable data masking using the `@unmask` directive. Apply this to any named fragment to receive all fields requested by the fragment. - - ```graphql - query { - user { - id - ...UserFields @unmask - } - } - ``` - - To help with migration, use the `@unmask` migrate mode which will add warnings when accessing fields that would otherwise be masked. + For detailed information on data masking, including how to incrementally adopt it in an existing applications, see the [data masking documentation](https://www.apollographql.com/docs/react/data/fragments#data-masking). - ```graphql - query { - user { - id - ...UserFields @unmask(mode: "migrate") - } - } - ``` +- [#12131](https://github.com/apollographql/apollo-client/pull/12131) [`21c3f08`](https://github.com/apollographql/apollo-client/commit/21c3f083013445707b7b50ae6390318bc568d0f5) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Allow `null` as a valid `from` value in `useFragment`. -### Patch Changes +
+

Detailed patch changes by pull request

- [#12126](https://github.com/apollographql/apollo-client/pull/12126) [`d10d702`](https://github.com/apollographql/apollo-client/commit/d10d702ee9bd4d1d1dee2551821140f2c49d5c0c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Maintain the existing document if its unchanged by the codemod and move to more naive whitespace formatting @@ -83,6 +66,8 @@ - [#12139](https://github.com/apollographql/apollo-client/pull/12139) [`5a53e15`](https://github.com/apollographql/apollo-client/commit/5a53e15e713e5eb2ebc9216615ea1a845fad2685) Thanks [@phryneas](https://github.com/phryneas)! - Fix issue that threw errors when masking partial data with `@unmask(mode: "migrate")`. +
+ ## 3.12.0-rc.4 ### Patch Changes