diff --git a/.changeset/cool-pants-smash.md b/.changeset/cool-pants-smash.md deleted file mode 100644 index 92b7e9d6874..00000000000 --- a/.changeset/cool-pants-smash.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -"@apollo/client": patch ---- - -Changes the default behavior of the `MaybeMasked` type to preserve types unless otherwise specified. This change makes it easier to upgrade from older versions of the client where types could have unexpectedly changed in the application due to the default of trying to unwrap types into unmasked types. This change also fixes the compilation performance regression experienced when simply upgrading the client since types are now preserved by default. - -A new `mode` option has now been introduced to allow for the old behavior. See the next section on migrating if you wish to maintain the old default behavior after upgrading to this version. - -### Migrating from <= v3.12.4 - -If you've adopted data masking and have opted in to using masked types by setting the `enabled` property to `true`, you can remove this configuration entirely: - -```diff --declare module "@apollo/client" { -- interface DataMasking { -- mode: "unmask" -- } --} -``` - -If you prefer to specify the behavior explicitly, change the property from `enabled: true`, to `mode: "preserveTypes"`: - -```diff -declare module "@apollo/client" { - interface DataMasking { -- enabled: true -+ mode: "preserveTypes" - } -} -``` - -If you rely on the default behavior in 3.12.4 or below and would like to continue to use unmasked types by default, set the `mode` to `unmask`: - -```ts -declare module "@apollo/client" { - interface DataMasking { - mode: "unmask" - } -} -``` diff --git a/CHANGELOG.md b/CHANGELOG.md index adc45c38443..6f94749fc14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # @apollo/client +## 3.12.5 + +### Patch Changes + +- [#12252](https://github.com/apollographql/apollo-client/pull/12252) [`cb9cd4e`](https://github.com/apollographql/apollo-client/commit/cb9cd4ea251aab225adf5e4e4f3f69e1bbacee52) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Changes the default behavior of the `MaybeMasked` type to preserve types unless otherwise specified. This change makes it easier to upgrade from older versions of the client where types could have unexpectedly changed in the application due to the default of trying to unwrap types into unmasked types. This change also fixes the compilation performance regression experienced when simply upgrading the client since types are now preserved by default. + + A new `mode` option has now been introduced to allow for the old behavior. See the next section on migrating if you wish to maintain the old default behavior after upgrading to this version. + + ### Migrating from <= v3.12.4 + + If you've adopted data masking and have opted in to using masked types by setting the `enabled` property to `true`, you can remove this configuration entirely: + + ```diff + -declare module "@apollo/client" { + - interface DataMasking { + - mode: "unmask" + - } + -} + ``` + + If you prefer to specify the behavior explicitly, change the property from `enabled: true`, to `mode: "preserveTypes"`: + + ```diff + declare module "@apollo/client" { + interface DataMasking { + - enabled: true + + mode: "preserveTypes" + } + } + ``` + + If you rely on the default behavior in 3.12.4 or below and would like to continue to use unmasked types by default, set the `mode` to `unmask`: + + ```ts + declare module "@apollo/client" { + interface DataMasking { + mode: "unmask"; + } + } + ``` + ## 3.12.4 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index 6503dfb9530..0c256410e09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apollo/client", - "version": "3.12.4", + "version": "3.12.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apollo/client", - "version": "3.12.4", + "version": "3.12.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 7538bd3a651..70f0c82c577 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/client", - "version": "3.12.4", + "version": "3.12.5", "description": "A fully-featured caching GraphQL client.", "private": true, "keywords": [