@apollo/client 3.11.7 → 3.12.0-alpha.0
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/nasty-camels-pay.md +36 -0
- package/.changeset/pre.json +10 -0
- package/CHANGELOG.md +43 -0
- package/apollo-client.cjs +438 -111
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +218 -22
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +218 -22
- package/cache/core/cache.d.ts +13 -10
- package/cache/core/cache.js +32 -14
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +2 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -3
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/inMemoryCache.d.ts +3 -1
- package/cache/inmemory/inMemoryCache.js +7 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +14 -6
- package/core/ApolloClient.js +14 -6
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +17 -14
- package/core/ObservableQuery.js +29 -16
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +18 -3
- package/core/QueryManager.js +39 -14
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +285 -37
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +285 -37
- package/core/index.d.ts +1 -0
- package/core/index.js.map +1 -1
- package/core/masking.d.ts +4 -0
- package/core/masking.js +212 -0
- package/core/masking.js.map +1 -0
- package/core/types.d.ts +3 -2
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +8 -6
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +131 -87
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +131 -87
- package/invariantErrorCodes.js +140 -86
- 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 +6 -6
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +6 -6
- package/link/http/selectHttpOptionsAndBody.js +3 -3
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- 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/index.d.ts +2 -0
- package/masking/index.js +2 -0
- package/masking/index.js.map +1 -0
- package/masking/internal/types.d.ts +15 -0
- package/masking/internal/types.js +2 -0
- package/masking/internal/types.js.map +1 -0
- package/masking/masking.cjs +3 -0
- package/masking/masking.cjs.map +1 -0
- package/masking/masking.cjs.native.js +3 -0
- package/masking/masking.d.cts +1 -0
- package/masking/package.json +8 -0
- package/masking/types.d.ts +44 -0
- package/masking/types.js +2 -0
- package/masking/types.js.map +1 -0
- package/package.json +2 -1
- 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 +24 -16
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +24 -16
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useFragment.d.ts +4 -3
- package/react/hooks/useFragment.js +12 -5
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +1 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.d.ts +4 -3
- package/react/hooks/useQuery.js +2 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +2 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +6 -5
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +5 -4
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- 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/react/types/types.d.ts +18 -42
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +3 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +3 -3
- package/testing/core/mocking/mockLink.d.ts +3 -2
- package/testing/core/mocking/mockLink.js +3 -3
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -0
- package/testing/core/mocking/mockQueryManager.js +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/internal/disposables/index.d.ts +1 -0
- package/testing/internal/disposables/index.js +1 -0
- package/testing/internal/disposables/index.js.map +1 -1
- package/testing/internal/disposables/withProdMode.d.ts +4 -0
- package/testing/internal/disposables/withProdMode.js +10 -0
- package/testing/internal/disposables/withProdMode.js.map +1 -0
- package/testing/internal/scenarios/index.d.ts +28 -0
- package/testing/internal/scenarios/index.js +18 -2
- package/testing/internal/scenarios/index.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +1 -0
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.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.d.ts +3 -1
- package/utilities/graphql/directives.js +39 -5
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.d.ts +1 -0
- package/utilities/graphql/transform.js +15 -2
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +7 -3
- package/utilities/index.js +4 -3
- package/utilities/index.js.map +1 -1
- package/utilities/promises/preventUnhandledRejection.d.ts +2 -0
- package/utilities/promises/preventUnhandledRejection.js +5 -0
- package/utilities/promises/preventUnhandledRejection.js.map +1 -0
- package/utilities/subscriptions/relay/relay.cjs.map +1 -1
- package/utilities/subscriptions/urql/urql.cjs.map +1 -1
- package/utilities/types/NoInfer.d.ts +27 -0
- package/utilities/types/NoInfer.js +2 -0
- package/utilities/types/NoInfer.js.map +1 -0
- package/utilities/types/Prettify.d.ts +4 -0
- package/utilities/types/Prettify.js +2 -0
- package/utilities/types/Prettify.js.map +1 -0
- package/utilities/types/UnionToIntersection.d.ts +2 -0
- package/utilities/types/UnionToIntersection.js +2 -0
- package/utilities/types/UnionToIntersection.js.map +1 -0
- package/utilities/utilities.cjs +73 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +73 -19
- package/version.js +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@apollo/client": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
To enable data masking in Apollo Client, set the `dataMasking` option to `true`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
new ApolloClient({
|
|
11
|
+
dataMasking: true,
|
|
12
|
+
// ... other options
|
|
13
|
+
})
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
You can selectively disable data masking using the `@unmask` directive. Apply this to any named fragment to receive all fields requested by the fragment.
|
|
17
|
+
|
|
18
|
+
```graphql
|
|
19
|
+
query {
|
|
20
|
+
user {
|
|
21
|
+
id
|
|
22
|
+
...UserFields @unmask
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To help with migration, use the `@unmask` migrate mode which will add warnings when accessing fields that would otherwise be masked.
|
|
28
|
+
|
|
29
|
+
```graphql
|
|
30
|
+
query {
|
|
31
|
+
user {
|
|
32
|
+
id
|
|
33
|
+
...UserFields @unmask(mode: "migrate")
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 3.12.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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.
|
|
8
|
+
|
|
9
|
+
To enable data masking in Apollo Client, set the `dataMasking` option to `true`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
new ApolloClient({
|
|
13
|
+
dataMasking: true,
|
|
14
|
+
// ... other options
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
You can selectively disable data masking using the `@unmask` directive. Apply this to any named fragment to receive all fields requested by the fragment.
|
|
19
|
+
|
|
20
|
+
```graphql
|
|
21
|
+
query {
|
|
22
|
+
user {
|
|
23
|
+
id
|
|
24
|
+
...UserFields @unmask
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To help with migration, use the `@unmask` migrate mode which will add warnings when accessing fields that would otherwise be masked.
|
|
30
|
+
|
|
31
|
+
```graphql
|
|
32
|
+
query {
|
|
33
|
+
user {
|
|
34
|
+
id
|
|
35
|
+
...UserFields @unmask(mode: "migrate")
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 3.11.8
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [#12054](https://github.com/apollographql/apollo-client/pull/12054) [`35cf186`](https://github.com/apollographql/apollo-client/commit/35cf186ed9237e41735f150e0cbf4edd995ab0d9) Thanks [@phryneas](https://github.com/phryneas)! - Fixed a bug where incorrect object access in some Safari extensions could cause a crash.
|
|
45
|
+
|
|
3
46
|
## 3.11.7
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|