@apollo/client 3.12.0-alpha.0 → 3.12.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/brown-readers-smash.md +5 -0
- package/.changeset/cold-apes-bow.md +5 -0
- package/.changeset/early-bobcats-eat.md +5 -0
- package/.changeset/flat-beans-knock.md +15 -0
- package/.changeset/gorgeous-zebras-confess.md +5 -0
- package/.changeset/kind-toys-tie.md +5 -0
- package/.changeset/long-zoos-ring.md +5 -0
- package/.changeset/nervous-owls-hear.md +5 -0
- package/.changeset/nice-countries-share.md +5 -0
- package/.changeset/pre.json +13 -2
- package/.changeset/slimy-points-end.md +5 -0
- package/.changeset/small-bears-confess.md +5 -0
- package/CHANGELOG.md +52 -0
- package/apollo-client.cjs +187 -93
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +59 -25
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +59 -25
- package/cache/inmemory/policies.js +12 -9
- package/cache/inmemory/policies.js.map +1 -1
- package/config/jest/setup.js +5 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.js +7 -3
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +2 -0
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts +4 -1
- package/core/QueryManager.js +26 -2
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +86 -25
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +86 -25
- package/core/masking.d.ts +6 -0
- package/core/masking.js +62 -20
- package/core/masking.js.map +1 -1
- package/dev/dev.cjs +66 -62
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +66 -62
- package/invariantErrorCodes.js +66 -61
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/masking/internal/types.d.ts +2 -2
- package/masking/internal/types.js.map +1 -1
- package/masking/types.d.ts +2 -2
- package/masking/types.js.map +1 -1
- package/package.json +4 -3
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +34 -20
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +34 -20
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useFragment.d.ts +1 -1
- package/react/hooks/useFragment.js +33 -19
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +2 -2
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +3 -3
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +3 -3
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/testing/core/core.cjs +2 -2
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +2 -2
- package/testing/core/mocking/mockLink.js +2 -2
- package/testing/internal/ObservableStream.d.ts +11 -15
- package/testing/internal/ObservableStream.js +18 -62
- package/testing/internal/ObservableStream.js.map +1 -1
- package/testing/internal/index.d.ts +1 -2
- package/testing/internal/index.js +1 -2
- package/testing/internal/index.js.map +1 -1
- package/testing/internal/renderHelpers.d.ts +13 -2
- package/testing/internal/renderHelpers.js +20 -12
- package/testing/internal/renderHelpers.js.map +1 -1
- package/testing/matchers/index.js +0 -3
- package/testing/matchers/index.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +7 -7
- package/utilities/graphql/fragments.d.ts +1 -0
- package/utilities/graphql/fragments.js +18 -3
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +8 -2
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +1 -1
- package/utilities/index.js +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/utilities.cjs +41 -22
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +41 -22
- package/version.js +1 -1
- package/testing/internal/profile/Render.d.ts +0 -69
- package/testing/internal/profile/Render.js +0 -144
- package/testing/internal/profile/Render.js.map +0 -1
- package/testing/internal/profile/context.d.ts +0 -10
- package/testing/internal/profile/context.js +0 -14
- package/testing/internal/profile/context.js.map +0 -1
- package/testing/internal/profile/index.d.ts +0 -4
- package/testing/internal/profile/index.js +0 -2
- package/testing/internal/profile/index.js.map +0 -1
- package/testing/internal/profile/profile.d.ts +0 -109
- package/testing/internal/profile/profile.js +0 -304
- package/testing/internal/profile/profile.js.map +0 -1
- package/testing/internal/profile/traces.d.ts +0 -7
- package/testing/internal/profile/traces.js +0 -30
- package/testing/internal/profile/traces.js.map +0 -1
- package/testing/matchers/ProfiledComponent.d.ts +0 -8
- package/testing/matchers/ProfiledComponent.js +0 -110
- package/testing/matchers/ProfiledComponent.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@apollo/client": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Provide a codemod that applies `@unmask` to all named fragments for all operations and fragments. To use the codemod, run the following command:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npx jscodeshift -t node_modules/@apollo/client/scripts/codemods/data-masking/unmask.ts --extensions tsx --parser tsx path/to/app/
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To customize the tag used to search for GraphQL operations, use the `--tag` option. By default the codemod looks for `gql` and `graphql` tags.
|
|
12
|
+
|
|
13
|
+
To apply the directive in migrate mode in order to receive runtime warnings on potentially masked fields, use the `--mode migrate` option.
|
|
14
|
+
|
|
15
|
+
For more information on the options that can be used with `jscodeshift`, check out the [`jscodeshift` documentation](https://github.com/facebook/jscodeshift).
|
package/.changeset/pre.json
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mode": "pre",
|
|
3
|
-
"tag": "
|
|
3
|
+
"tag": "rc",
|
|
4
4
|
"initialVersions": {
|
|
5
5
|
"@apollo/client": "3.11.5"
|
|
6
6
|
},
|
|
7
7
|
"changesets": [
|
|
8
|
-
"
|
|
8
|
+
"brown-readers-smash",
|
|
9
|
+
"cold-apes-bow",
|
|
10
|
+
"early-bobcats-eat",
|
|
11
|
+
"flat-beans-knock",
|
|
12
|
+
"gorgeous-zebras-confess",
|
|
13
|
+
"kind-toys-tie",
|
|
14
|
+
"long-zoos-ring",
|
|
15
|
+
"nasty-camels-pay",
|
|
16
|
+
"nervous-owls-hear",
|
|
17
|
+
"nice-countries-share",
|
|
18
|
+
"slimy-points-end",
|
|
19
|
+
"small-bears-confess"
|
|
9
20
|
]
|
|
10
21
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 3.12.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#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
|
|
12
|
+
|
|
13
|
+
- [#12134](https://github.com/apollographql/apollo-client/pull/12134) [`cfaf4ef`](https://github.com/apollographql/apollo-client/commit/cfaf4efc6dea56ae46a5b5199d8ed9414b0f17d8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix issue where data went missing when an unmasked fragment in migrate mode selected fields that the parent did not.
|
|
14
|
+
|
|
15
|
+
- [#12130](https://github.com/apollographql/apollo-client/pull/12130) [`1e7d009`](https://github.com/apollographql/apollo-client/commit/1e7d009e4a52949dab0065f3219dfe148837531e) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix error thrown when applying unmask migrate mode warnings on interface types with selection sets that contain inline fragment conditions.
|
|
16
|
+
|
|
17
|
+
- [#12126](https://github.com/apollographql/apollo-client/pull/12126) [`d10d702`](https://github.com/apollographql/apollo-client/commit/d10d702ee9bd4d1d1dee2551821140f2c49d5c0c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure documents unchanged by the codemod are left untouched.
|
|
18
|
+
|
|
19
|
+
- [#12133](https://github.com/apollographql/apollo-client/pull/12133) [`a6ece37`](https://github.com/apollographql/apollo-client/commit/a6ece375119ce12c19749471c55b0059843a7217) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure `null` is retained in nullable types when unmasking a type with the `Unmasked` helper type.
|
|
20
|
+
|
|
21
|
+
## 3.12.0-rc.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#12116](https://github.com/apollographql/apollo-client/pull/12116) [`8ae6e4e`](https://github.com/apollographql/apollo-client/commit/8ae6e4e5cec296c3910fdffb0ce51a0f5f06c5d3) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Prevent field accessor warnings when using `@unmask(mode: "migrate")` on objects that are passed into `cache.identify`.
|
|
26
|
+
|
|
27
|
+
- [#12120](https://github.com/apollographql/apollo-client/pull/12120) [`6a98e76`](https://github.com/apollographql/apollo-client/commit/6a98e76af5c800a91a748c498611b55c33e02c68) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Provide a codemod that applies `@unmask` to all named fragments for all operations and fragments. To use the codemod, run the following command:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
npx jscodeshift -t node_modules/@apollo/client/scripts/codemods/data-masking/unmask.ts --extensions tsx --parser tsx path/to/app/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To customize the tag used to search for GraphQL operations, use the `--tag` option. By default the codemod looks for `gql` and `graphql` tags.
|
|
34
|
+
|
|
35
|
+
To apply the directive in migrate mode in order to receive runtime warnings on potentially masked fields, use the `--mode migrate` option.
|
|
36
|
+
|
|
37
|
+
For more information on the options that can be used with `jscodeshift`, check out the [`jscodeshift` documentation](https://github.com/facebook/jscodeshift).
|
|
38
|
+
|
|
39
|
+
- [#12121](https://github.com/apollographql/apollo-client/pull/12121) [`1085a95`](https://github.com/apollographql/apollo-client/commit/1085a95e4430da35d19033613e73f315a0aede9e) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Warn when using data masking with "no-cache" operations.
|
|
40
|
+
|
|
41
|
+
- [#12114](https://github.com/apollographql/apollo-client/pull/12114) [`1d4ce00`](https://github.com/apollographql/apollo-client/commit/1d4ce0034395147445165022f7d23f42ff638d8a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix error when combining `@unmask` and `@defer` directives on a fragment spread when data masking is enabled.
|
|
42
|
+
|
|
3
43
|
## 3.12.0-alpha.0
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
|
@@ -37,6 +77,18 @@
|
|
|
37
77
|
}
|
|
38
78
|
```
|
|
39
79
|
|
|
80
|
+
## 3.11.10
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- [#12093](https://github.com/apollographql/apollo-client/pull/12093) [`1765668`](https://github.com/apollographql/apollo-client/commit/1765668b7d495ef8a581f697bf9e4b7460455f13) Thanks [@mgmolisani](https://github.com/mgmolisani)! - Fixed a bug when evaluating the devtools flag with the new syntax `devtools.enabled` that could result to `true` when explicitly set to `false`.
|
|
85
|
+
|
|
86
|
+
## 3.11.9
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- [#12110](https://github.com/apollographql/apollo-client/pull/12110) [`a3f95c6`](https://github.com/apollographql/apollo-client/commit/a3f95c6f7623060bbf68b418b0ab268fabc0c9b6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where errors returned from a `fetchMore` call from a Suspense hook would cause a Suspense boundary to be shown indefinitely.
|
|
91
|
+
|
|
40
92
|
## 3.11.8
|
|
41
93
|
|
|
42
94
|
### Patch Changes
|