@apollo/client 4.0.0-alpha.20 → 4.0.0-alpha.22
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/CHANGELOG.md +113 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +22 -19
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +7 -8
- package/__cjs/core/ObservableQuery.cjs +15 -11
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +1 -2
- package/__cjs/core/QueryInfo.cjs +223 -34
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +34 -24
- package/__cjs/core/QueryManager.cjs +89 -265
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +13 -38
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +1 -1
- package/__cjs/core/networkStatus.cjs +7 -1
- package/__cjs/core/networkStatus.cjs.map +1 -1
- package/__cjs/core/networkStatus.d.cts +7 -1
- package/__cjs/core/types.d.cts +5 -4
- package/__cjs/invariantErrorCodes.cjs +99 -104
- package/__cjs/link/batch-http/batchHttpLink.cjs +14 -14
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/batch-http/batchHttpLink.d.cts +4 -0
- package/__cjs/link/batch-http/index.cjs +2 -1
- package/__cjs/link/batch-http/index.cjs.map +1 -1
- package/__cjs/link/batch-http/index.d.cts +1 -1
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +45 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +62 -0
- package/__cjs/link/client-awareness/index.cjs +6 -0
- package/__cjs/link/client-awareness/index.cjs.map +1 -0
- package/__cjs/link/client-awareness/index.d.cts +2 -0
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/core/types.d.cts +1 -6
- package/__cjs/link/http/BaseHttpLink.cjs +117 -0
- package/__cjs/link/http/BaseHttpLink.cjs.map +1 -0
- package/__cjs/link/http/BaseHttpLink.d.cts +6 -0
- package/__cjs/link/http/HttpLink.cjs +8 -5
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.d.cts +16 -4
- package/__cjs/link/http/index.cjs +4 -3
- package/__cjs/link/http/index.cjs.map +1 -1
- package/__cjs/link/http/index.d.cts +2 -2
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs +6 -5
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +7 -5
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/local-state/LocalState.cjs +0 -8
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskDefinition.cjs.map +1 -1
- package/__cjs/masking/maskFragment.cjs +2 -10
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskOperation.cjs +1 -9
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/utils.cjs +0 -8
- package/__cjs/masking/utils.cjs.map +1 -1
- package/__cjs/masking/utils.d.cts +0 -1
- package/__cjs/react/context/ApolloConsumer.cjs +1 -1
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +3 -4
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +0 -8
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.d.cts +6 -0
- package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
- package/__cjs/utilities/index.cjs +1 -16
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +0 -13
- package/__cjs/utilities/internal/checkDocument.cjs +47 -13
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/checkDocument.d.cts +1 -1
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs +1 -0
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.d.cts +0 -1
- package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +7 -8
- package/core/ApolloClient.js +23 -20
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +1 -2
- package/core/ObservableQuery.js +15 -11
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +34 -24
- package/core/QueryInfo.js +221 -34
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +13 -38
- package/core/QueryManager.js +91 -267
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +7 -1
- package/core/networkStatus.js +7 -1
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +5 -4
- package/invariantErrorCodes.js +99 -104
- package/legacyEntryPoints/link/client-awareness/client-awareness.cjs +1 -0
- package/legacyEntryPoints/link/client-awareness/client-awareness.d.cts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.d.ts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.js +1 -0
- package/link/batch-http/batchHttpLink.d.ts +4 -0
- package/link/batch-http/batchHttpLink.js +11 -12
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/batch-http/index.d.ts +1 -1
- package/link/batch-http/index.js +1 -1
- package/link/batch-http/index.js.map +1 -1
- package/link/client-awareness/ClientAwarenessLink.d.ts +62 -0
- package/link/client-awareness/ClientAwarenessLink.js +41 -0
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -0
- package/link/client-awareness/index.d.ts +2 -0
- package/link/client-awareness/index.js +2 -0
- package/link/client-awareness/index.js.map +1 -0
- package/link/core/ApolloLink.js +2 -2
- package/link/core/types.d.ts +1 -6
- package/link/http/BaseHttpLink.d.ts +6 -0
- package/link/http/BaseHttpLink.js +113 -0
- package/link/http/BaseHttpLink.js.map +1 -0
- package/link/http/HttpLink.d.ts +16 -4
- package/link/http/HttpLink.js +6 -4
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/index.d.ts +2 -2
- package/link/http/index.js +2 -2
- package/link/http/index.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/selectHttpOptionsAndBody.js +6 -5
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +7 -5
- package/link/persisted-queries/index.js.map +1 -1
- package/local-state/LocalState.js +0 -8
- package/local-state/LocalState.js.map +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskDefinition.js.map +1 -1
- package/masking/maskFragment.js +2 -10
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.js +1 -9
- package/masking/maskOperation.js.map +1 -1
- package/masking/utils.d.ts +0 -1
- package/masking/utils.js +0 -7
- package/masking/utils.js.map +1 -1
- package/package.json +7 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.d.ts +0 -8
- package/react/hooks/useLazyQuery.js +3 -4
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/testing/core/mocking/mockLink.js +4 -4
- package/utilities/caching/sizes.d.ts +6 -0
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/index.d.ts +0 -13
- package/utilities/index.js +0 -12
- package/utilities/index.js.map +1 -1
- package/utilities/internal/checkDocument.d.ts +1 -1
- package/utilities/internal/checkDocument.js +46 -12
- package/utilities/internal/checkDocument.js.map +1 -1
- package/utilities/internal/getFragmentDefinition.js +3 -3
- package/utilities/internal/getFragmentFromSelection.js +1 -1
- package/utilities/internal/getFragmentQueryDocument.js +2 -2
- package/utilities/internal/getMainDefinition.js +1 -1
- package/utilities/internal/getMemoryInternals.d.ts +0 -1
- package/utilities/internal/getMemoryInternals.js +1 -0
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/getQueryDefinition.js +1 -1
- package/utilities/internal/removeDirectivesFromDocument.js +1 -1
- package/utilities/internal/shouldInclude.js +4 -4
- package/utilities/internal/valueToObjectRepresentation.js +1 -1
- package/version.js +1 -1
- package/__cjs/link/http/createHttpLink.cjs +0 -151
- package/__cjs/link/http/createHttpLink.cjs.map +0 -1
- package/__cjs/link/http/createHttpLink.d.cts +0 -4
- package/link/http/createHttpLink.d.ts +0 -4
- package/link/http/createHttpLink.js +0 -143
- package/link/http/createHttpLink.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 4.0.0-alpha.22
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#12673](https://github.com/apollographql/apollo-client/pull/12673) [`cee90ab`](https://github.com/apollographql/apollo-client/commit/cee90abcd2a9c91c5fdf872cf2d1c12deaa6593e) Thanks [@phryneas](https://github.com/phryneas)! - The `includeExtensions` option of `HttpLink` and `BatchHttpLink` now defaults
|
|
8
|
+
to `true`.
|
|
9
|
+
|
|
10
|
+
If `includeExtensions` is `true`, but `extensions` is not set or empty, extensions
|
|
11
|
+
will not be included in outgoing requests.
|
|
12
|
+
|
|
13
|
+
- [#12673](https://github.com/apollographql/apollo-client/pull/12673) [`cee90ab`](https://github.com/apollographql/apollo-client/commit/cee90abcd2a9c91c5fdf872cf2d1c12deaa6593e) Thanks [@phryneas](https://github.com/phryneas)! - The `ApolloClient` constructor options `name` and `version` that are used to
|
|
14
|
+
configure the client awareness feature have moved onto a `clientAwareness` key.
|
|
15
|
+
|
|
16
|
+
```diff
|
|
17
|
+
const client = new ApolloClient({
|
|
18
|
+
// ..
|
|
19
|
+
- name: "my-app",
|
|
20
|
+
- version: "1.0.0",
|
|
21
|
+
+ clientAwareness: {
|
|
22
|
+
+ name: "my-app",
|
|
23
|
+
+ version: "1.0.0",
|
|
24
|
+
+ },
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- [#12690](https://github.com/apollographql/apollo-client/pull/12690) [`5812759`](https://github.com/apollographql/apollo-client/commit/5812759b6659df49277635e89492c0d72c3b57d6) Thanks [@phryneas](https://github.com/phryneas)! - Aliasing any other field to `__typename` is now forbidden.
|
|
29
|
+
|
|
30
|
+
- [#12690](https://github.com/apollographql/apollo-client/pull/12690) [`5812759`](https://github.com/apollographql/apollo-client/commit/5812759b6659df49277635e89492c0d72c3b57d6) Thanks [@phryneas](https://github.com/phryneas)! - Aliasing a field to an alias beginning with `__ac_` is now forbidden - this namespace is now reserved for internal use.
|
|
31
|
+
|
|
32
|
+
- [#12673](https://github.com/apollographql/apollo-client/pull/12673) [`cee90ab`](https://github.com/apollographql/apollo-client/commit/cee90abcd2a9c91c5fdf872cf2d1c12deaa6593e) Thanks [@phryneas](https://github.com/phryneas)! - Adds enhanced client awareness to the client.
|
|
33
|
+
|
|
34
|
+
`HttpLink` and `BatchHttpLink` will now per default send information about the
|
|
35
|
+
client library you are using in `extensions`.
|
|
36
|
+
|
|
37
|
+
This could look like this:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"query": "query GetUser($id: ID!) { user(id: $id) { __typename id name } }",
|
|
42
|
+
"variables": {
|
|
43
|
+
"id": 5
|
|
44
|
+
},
|
|
45
|
+
"extensions": {
|
|
46
|
+
"clientLibrary": {
|
|
47
|
+
"name": "@apollo/client",
|
|
48
|
+
"version": "4.0.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This feature can be disabled by passing `enhancedClientAwareness: { transport: false }` to your
|
|
55
|
+
`ApolloClient`, `HttpLink` or `BatchHttpLink` constructor options.
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- [#12698](https://github.com/apollographql/apollo-client/pull/12698) [`be77d1a`](https://github.com/apollographql/apollo-client/commit/be77d1a6ddf719cab4780a0679fcd98556ac7f22) Thanks [@phryneas](https://github.com/phryneas)! - Adjusted the accept header for multipart requests according to the new GraphQL over HTTP spec with these changes:
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
-multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json
|
|
63
|
+
+multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/graphql-response+json,application/json;q=0.9
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```diff
|
|
67
|
+
-multipart/mixed;deferSpec=20220824,application/json
|
|
68
|
+
+multipart/mixed;deferSpec=20220824,application/graphql-response+json,application/json;q=0.9
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- [#12673](https://github.com/apollographql/apollo-client/pull/12673) [`cee90ab`](https://github.com/apollographql/apollo-client/commit/cee90abcd2a9c91c5fdf872cf2d1c12deaa6593e) Thanks [@phryneas](https://github.com/phryneas)! - Add the new `ClientAwarenessLink`.
|
|
72
|
+
|
|
73
|
+
This link is already included in `HttpLink` and `BatchHttpLink` to enable the
|
|
74
|
+
"client awareness" and "enhanced client awareness" features, but you can also use
|
|
75
|
+
`ClientAwarenessLink` directly in your link chain to combine it with other
|
|
76
|
+
terminating links.
|
|
77
|
+
|
|
78
|
+
If you want to save the bundle size that `ClientAwarenessLink` adds to `HttpLink`
|
|
79
|
+
and `BatchHttpLink`, you can use `BaseHttpLink` or `BaseBatchHttpLink` instead.
|
|
80
|
+
These links come without the `ClientAwarenessLink` included.
|
|
81
|
+
|
|
82
|
+
For example:
|
|
83
|
+
|
|
84
|
+
```diff
|
|
85
|
+
import {
|
|
86
|
+
ApolloClient,
|
|
87
|
+
- HttpLink,
|
|
88
|
+
} from "@apollo/client";
|
|
89
|
+
+import { BaseHttpLink } from "@apollo/client/link/http";
|
|
90
|
+
|
|
91
|
+
const client = new ApolloClient({
|
|
92
|
+
- link: new HttpLink({
|
|
93
|
+
+ link: new BaseHttpLink({
|
|
94
|
+
uri,
|
|
95
|
+
}),
|
|
96
|
+
cache: new InMemoryCache(),
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- [#12698](https://github.com/apollographql/apollo-client/pull/12698) [`be77d1a`](https://github.com/apollographql/apollo-client/commit/be77d1a6ddf719cab4780a0679fcd98556ac7f22) Thanks [@phryneas](https://github.com/phryneas)! - Adds an `accept` option to `HttpOptions` that allows to add additional `Accept` headers to be merged in without overriding user-specified or default accept headers.
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- [#12673](https://github.com/apollographql/apollo-client/pull/12673) [`cee90ab`](https://github.com/apollographql/apollo-client/commit/cee90abcd2a9c91c5fdf872cf2d1c12deaa6593e) Thanks [@phryneas](https://github.com/phryneas)! - Fixed a bug in `PersistedQueryLink` where the `persistedQuery` extension would still be sent after a `PersistedQueryNotSupported` if `includeExtensions` was enabled on `HttpLink`.
|
|
105
|
+
|
|
106
|
+
## 4.0.0-alpha.21
|
|
107
|
+
|
|
108
|
+
### Major Changes
|
|
109
|
+
|
|
110
|
+
- [#12686](https://github.com/apollographql/apollo-client/pull/12686) [`dc4b1d0`](https://github.com/apollographql/apollo-client/commit/dc4b1d0d2479a37067113b7bd161a550fb8e4df6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - A `@defer` query that has not yet finished streaming is now considered loading and thus the `loading` flag will be `true` until the response has completed. A new `NetworkStatus.streaming` value has been introduced and will be set as the `networkStatus` while the response is streaming.
|
|
111
|
+
|
|
112
|
+
- [#12685](https://github.com/apollographql/apollo-client/pull/12685) [`3b74800`](https://github.com/apollographql/apollo-client/commit/3b748003df89ec69a6ad045fb47bbe9c3e62104c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the check and warning for `cache.fragmentMatches` when applying data masking. `cache.fragmentMatches` is a required API and data masking may crash when `cache.fragmentMatches` does not exist.
|
|
113
|
+
|
|
114
|
+
- [#12684](https://github.com/apollographql/apollo-client/pull/12684) [`e697431`](https://github.com/apollographql/apollo-client/commit/e697431a9995fd1900e625c30a9065edd71111d9) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `context` from `useLazyQuery` hook options. If used, `context` must now be provided to the `execute` function. `context` will reset to `{}` if not provided as an option to `execute`.
|
|
115
|
+
|
|
3
116
|
## 4.0.0-alpha.20
|
|
4
117
|
|
|
5
118
|
### Major Changes
|
|
@@ -94,7 +94,7 @@ class ApolloCache {
|
|
|
94
94
|
if (environment_1.__DEV__) {
|
|
95
95
|
const actualFragmentName = fragmentName || (0, internal_1.getFragmentDefinition)(fragment).name.value;
|
|
96
96
|
if (!id) {
|
|
97
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
97
|
+
__DEV__ && invariant_1.invariant.warn(108, actualFragmentName);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
const diffOptions = {
|
|
@@ -82,7 +82,7 @@ class EntityStore {
|
|
|
82
82
|
// then there are no fields to be merged, so we're done.
|
|
83
83
|
if (!incoming)
|
|
84
84
|
return;
|
|
85
|
-
(0, invariant_1.invariant)(typeof dataId === "string",
|
|
85
|
+
(0, invariant_1.invariant)(typeof dataId === "string", 94);
|
|
86
86
|
const merged = new internal_1.DeepMerger(storeObjectReconciler).merge(existing, incoming);
|
|
87
87
|
// Even if merged === existing, existing may have come from a lower
|
|
88
88
|
// layer, so we always need to set this.data[dataId] on this level.
|
|
@@ -182,7 +182,7 @@ class EntityStore {
|
|
|
182
182
|
if (environment_1.__DEV__) {
|
|
183
183
|
const checkReference = (ref) => {
|
|
184
184
|
if (this.lookup(ref.__ref) === undefined) {
|
|
185
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
185
|
+
__DEV__ && invariant_1.invariant.warn(95, ref);
|
|
186
186
|
return true;
|
|
187
187
|
}
|
|
188
188
|
};
|
|
@@ -211,7 +211,7 @@ class EntityStore {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
if (seenReference && someNonReference !== undefined) {
|
|
214
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
214
|
+
__DEV__ && invariant_1.invariant.warn(96, someNonReference);
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
@@ -41,7 +41,7 @@ function keyFieldsFnFromSpecifier(specifier) {
|
|
|
41
41
|
// context.readField for this extraction.
|
|
42
42
|
extracted = extractKeyPath(object, schemaKeyPath, extractKey);
|
|
43
43
|
}
|
|
44
|
-
(0, invariant_1.invariant)(extracted !== void 0,
|
|
44
|
+
(0, invariant_1.invariant)(extracted !== void 0, 97, schemaKeyPath.join("."), object);
|
|
45
45
|
return extracted;
|
|
46
46
|
}));
|
|
47
47
|
return `${context.typename}:${JSON.stringify(keyObject)}`;
|
|
@@ -204,7 +204,7 @@ class Policies {
|
|
|
204
204
|
const rootId = "ROOT_" + which.toUpperCase();
|
|
205
205
|
const old = this.rootTypenamesById[rootId];
|
|
206
206
|
if (typename !== old) {
|
|
207
|
-
(0, invariant_1.invariant)(!old || old === which,
|
|
207
|
+
(0, invariant_1.invariant)(!old || old === which, 98, which);
|
|
208
208
|
// First, delete any old __typename associated with this rootId from
|
|
209
209
|
// rootIdsByTypename.
|
|
210
210
|
if (old)
|
|
@@ -349,7 +349,7 @@ class Policies {
|
|
|
349
349
|
if (supertypeSet.has(supertype)) {
|
|
350
350
|
if (!typenameSupertypeSet.has(supertype)) {
|
|
351
351
|
if (checkingFuzzySubtypes) {
|
|
352
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
352
|
+
__DEV__ && invariant_1.invariant.warn(99, typename, supertype);
|
|
353
353
|
}
|
|
354
354
|
// Record positive results for faster future lookup.
|
|
355
355
|
// Unfortunately, we cannot safely cache negative results,
|
|
@@ -560,7 +560,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
if (environment_1.__DEV__ && options.from === void 0) {
|
|
563
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
563
|
+
__DEV__ && invariant_1.invariant.warn(100, (0, internal_1.stringifyForDisplay)(Array.from(readFieldArgs)));
|
|
564
564
|
}
|
|
565
565
|
if (void 0 === options.variables) {
|
|
566
566
|
options.variables = variables;
|
|
@@ -570,7 +570,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
570
570
|
function makeMergeObjectsFunction(store) {
|
|
571
571
|
return function mergeObjects(existing, incoming) {
|
|
572
572
|
if ((0, internal_1.isArray)(existing) || (0, internal_1.isArray)(incoming)) {
|
|
573
|
-
throw (0, invariant_1.newInvariantError)(
|
|
573
|
+
throw (0, invariant_1.newInvariantError)(101);
|
|
574
574
|
}
|
|
575
575
|
// These dynamic checks are necessary because the parameters of a
|
|
576
576
|
// custom merge function can easily have the any type, so the type
|