@apollo/client 3.8.4 → 3.8.6
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/apollo-client.cjs +168 -149
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +46 -11
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +46 -11
- package/cache/core/types/common.d.ts +2 -2
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +35 -0
- package/cache/inmemory/entityStore.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.js +3 -3
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +10 -11
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +0 -2
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +0 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +11 -11
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +27 -30
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +27 -30
- package/dev/dev.cjs +124 -100
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +124 -100
- package/dev/loadErrorMessageHandler.js +2 -2
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +95 -80
- 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/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/package.json +22 -22
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +7 -2
- package/react/cache/QueryReference.js.map +1 -1
- package/react/cache/index.d.ts +0 -4
- package/react/cache/index.d.ts.map +1 -1
- package/react/cache/index.js +0 -14
- package/react/cache/index.js.map +1 -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 +15 -10
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +15 -10
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- 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/react.cjs +1 -218
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +1 -218
- package/react/types/types.d.ts +0 -3
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockLink.js +1 -1
- package/testing/internal/ObservableStream.d.ts +26 -0
- package/testing/internal/ObservableStream.d.ts.map +1 -0
- package/testing/internal/ObservableStream.js +101 -0
- package/testing/internal/ObservableStream.js.map +1 -0
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.d.ts.map +1 -1
- package/testing/internal/index.js +1 -0
- package/testing/internal/index.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -1
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -1
- package/utilities/globals/globals.cjs +29 -19
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +29 -19
- package/utilities/globals/invariantWrappers.d.ts.map +1 -1
- package/utilities/globals/invariantWrappers.js +28 -18
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts +5 -0
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +1 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js +17 -34
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/utilities.cjs +36 -53
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +36 -53
- package/version.js +1 -1
package/dev/dev.cjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var globals = require('../utilities/globals');
|
|
6
|
-
var tslib = require('tslib');
|
|
7
6
|
var tsInvariant = require('ts-invariant');
|
|
8
7
|
|
|
9
8
|
const errorCodes = // This file is used by the error message display website and the
|
|
@@ -16,45 +15,45 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
16
15
|
message: "store.merge expects a string ID"
|
|
17
16
|
},
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
4: {
|
|
20
19
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
21
20
|
condition: "extracted !== void 0",
|
|
22
21
|
message: "Missing field '%s' while extracting keyFields from %s"
|
|
23
22
|
},
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
5: {
|
|
26
25
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
27
26
|
condition: "!old || old === which",
|
|
28
27
|
message: "Cannot change root %s __typename more than once"
|
|
29
28
|
},
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
8: {
|
|
32
31
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
33
32
|
message: "Cannot automatically merge arrays"
|
|
34
33
|
},
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
9: {
|
|
37
36
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
38
37
|
message: "No fragment named %s"
|
|
39
38
|
},
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
10: {
|
|
42
41
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
43
42
|
condition: "!isReference(value)",
|
|
44
43
|
message: "Missing selection set for object of type %s returned for query field %s"
|
|
45
44
|
},
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
11: {
|
|
48
47
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
49
48
|
message: "Could not identify object %s"
|
|
50
49
|
},
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
13: {
|
|
53
52
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
54
53
|
message: "No fragment named %s"
|
|
55
54
|
},
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
15: {
|
|
58
57
|
file: "@apollo/client/core/ApolloClient.js",
|
|
59
58
|
|
|
60
59
|
message: "To initialize Apollo Client, you must specify a 'cache' property " +
|
|
@@ -62,7 +61,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
62
61
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
63
62
|
},
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
16: {
|
|
66
65
|
file: "@apollo/client/core/ApolloClient.js",
|
|
67
66
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
68
67
|
|
|
@@ -72,42 +71,42 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
72
71
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
73
72
|
},
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
18: {
|
|
76
75
|
file: "@apollo/client/core/LocalState.js",
|
|
77
76
|
condition: "fragment",
|
|
78
77
|
message: "No fragment named %s"
|
|
79
78
|
},
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
19: {
|
|
82
81
|
file: "@apollo/client/core/LocalState.js",
|
|
83
82
|
condition: "fragment",
|
|
84
83
|
message: "No fragment named %s"
|
|
85
84
|
},
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
22: {
|
|
88
87
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
89
88
|
condition: "pollInterval",
|
|
90
89
|
message: "Attempted to start a polling query without a polling interval."
|
|
91
90
|
},
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
25: {
|
|
94
93
|
file: "@apollo/client/core/QueryManager.js",
|
|
95
94
|
message: "QueryManager stopped while query was in flight"
|
|
96
95
|
},
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
26: {
|
|
99
98
|
file: "@apollo/client/core/QueryManager.js",
|
|
100
99
|
condition: "mutation",
|
|
101
100
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
102
101
|
},
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
27: {
|
|
105
104
|
file: "@apollo/client/core/QueryManager.js",
|
|
106
105
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
107
106
|
message: "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."
|
|
108
107
|
},
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
28: {
|
|
111
110
|
file: "@apollo/client/core/QueryManager.js",
|
|
112
111
|
condition: "options.query",
|
|
113
112
|
|
|
@@ -115,45 +114,45 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
115
114
|
"in the query option."
|
|
116
115
|
},
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
29: {
|
|
119
118
|
file: "@apollo/client/core/QueryManager.js",
|
|
120
119
|
condition: "options.query.kind === \"Document\"",
|
|
121
120
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
122
121
|
},
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
30: {
|
|
125
124
|
file: "@apollo/client/core/QueryManager.js",
|
|
126
125
|
condition: "!options.returnPartialData",
|
|
127
126
|
message: "returnPartialData option only supported on watchQuery."
|
|
128
127
|
},
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
31: {
|
|
131
130
|
file: "@apollo/client/core/QueryManager.js",
|
|
132
131
|
condition: "!options.pollInterval",
|
|
133
132
|
message: "pollInterval option only supported on watchQuery."
|
|
134
133
|
},
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
32: {
|
|
137
136
|
file: "@apollo/client/core/QueryManager.js",
|
|
138
137
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
139
138
|
},
|
|
140
139
|
|
|
141
|
-
|
|
140
|
+
36: {
|
|
142
141
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
143
142
|
message: "request is not implemented"
|
|
144
143
|
},
|
|
145
144
|
|
|
146
|
-
|
|
145
|
+
37: {
|
|
147
146
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
148
147
|
message: "\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "
|
|
149
148
|
},
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
39: {
|
|
152
151
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
153
152
|
message: "Network request failed. %s is not serializable: %s"
|
|
154
153
|
},
|
|
155
154
|
|
|
156
|
-
|
|
155
|
+
40: {
|
|
157
156
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
158
157
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
159
158
|
|
|
@@ -162,18 +161,18 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
162
161
|
"parameter."
|
|
163
162
|
},
|
|
164
163
|
|
|
165
|
-
|
|
164
|
+
41: {
|
|
166
165
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
167
166
|
condition: "forward",
|
|
168
167
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
169
168
|
},
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
43: {
|
|
172
171
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
173
172
|
message: "illegal argument: %s"
|
|
174
173
|
},
|
|
175
174
|
|
|
176
|
-
|
|
175
|
+
44: {
|
|
177
176
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
178
177
|
condition: "context && context.client",
|
|
179
178
|
|
|
@@ -181,7 +180,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
181
180
|
"Wrap the root component in an <ApolloProvider>."
|
|
182
181
|
},
|
|
183
182
|
|
|
184
|
-
|
|
183
|
+
45: {
|
|
185
184
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
186
185
|
condition: "\"createContext\" in React",
|
|
187
186
|
|
|
@@ -191,7 +190,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
191
190
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
192
191
|
},
|
|
193
192
|
|
|
194
|
-
|
|
193
|
+
46: {
|
|
195
194
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
196
195
|
condition: "context.client",
|
|
197
196
|
|
|
@@ -199,7 +198,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
199
198
|
'sure you pass in your client via the "client" prop.'
|
|
200
199
|
},
|
|
201
200
|
|
|
202
|
-
|
|
201
|
+
47: {
|
|
203
202
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
204
203
|
condition: "this.withRef",
|
|
205
204
|
|
|
@@ -207,7 +206,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
207
206
|
"{ withRef: true } in the options"
|
|
208
207
|
},
|
|
209
208
|
|
|
210
|
-
|
|
209
|
+
48: {
|
|
211
210
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
212
211
|
condition: "operationOptions.withRef",
|
|
213
212
|
|
|
@@ -215,7 +214,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
215
214
|
"{ withRef: true } in the options"
|
|
216
215
|
},
|
|
217
216
|
|
|
218
|
-
|
|
217
|
+
49: {
|
|
219
218
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
220
219
|
condition: "!!client",
|
|
221
220
|
|
|
@@ -224,7 +223,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
224
223
|
"instance in via options."
|
|
225
224
|
},
|
|
226
225
|
|
|
227
|
-
|
|
226
|
+
51: {
|
|
228
227
|
file: "@apollo/client/react/hooks/useReadQuery.js",
|
|
229
228
|
condition: "internalQueryRef.promiseCache",
|
|
230
229
|
|
|
@@ -233,13 +232,13 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
233
232
|
"Please ensure you are passing the `queryRef` returned from `useBackgroundQuery`."
|
|
234
233
|
},
|
|
235
234
|
|
|
236
|
-
|
|
235
|
+
56: {
|
|
237
236
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
238
237
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
239
238
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
240
239
|
},
|
|
241
240
|
|
|
242
|
-
|
|
241
|
+
59: {
|
|
243
242
|
file: "@apollo/client/react/parser/index.js",
|
|
244
243
|
condition: "!!document && !!document.kind",
|
|
245
244
|
|
|
@@ -248,7 +247,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
248
247
|
"to convert your operation into a document"
|
|
249
248
|
},
|
|
250
249
|
|
|
251
|
-
|
|
250
|
+
60: {
|
|
252
251
|
file: "@apollo/client/react/parser/index.js",
|
|
253
252
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
254
253
|
|
|
@@ -256,7 +255,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
256
255
|
"You must include a query, subscription or mutation as well"
|
|
257
256
|
},
|
|
258
257
|
|
|
259
|
-
|
|
258
|
+
61: {
|
|
260
259
|
file: "@apollo/client/react/parser/index.js",
|
|
261
260
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
262
261
|
|
|
@@ -266,7 +265,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
266
265
|
"You can use 'compose' to join multiple operation types to a component"
|
|
267
266
|
},
|
|
268
267
|
|
|
269
|
-
|
|
268
|
+
62: {
|
|
270
269
|
file: "@apollo/client/react/parser/index.js",
|
|
271
270
|
condition: "definitions.length === 1",
|
|
272
271
|
|
|
@@ -275,114 +274,114 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
275
274
|
"You can use 'compose' to join multiple operation types to a component"
|
|
276
275
|
},
|
|
277
276
|
|
|
278
|
-
|
|
277
|
+
63: {
|
|
279
278
|
file: "@apollo/client/react/parser/index.js",
|
|
280
279
|
condition: "operation.type === type",
|
|
281
280
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
282
281
|
},
|
|
283
282
|
|
|
284
|
-
|
|
283
|
+
64: {
|
|
285
284
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
286
285
|
condition: "queryWithoutConnection",
|
|
287
286
|
message: "query is required"
|
|
288
287
|
},
|
|
289
288
|
|
|
290
|
-
|
|
289
|
+
65: {
|
|
291
290
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
292
291
|
condition: "Array.isArray(cacheKeys)",
|
|
293
292
|
message: "`getCacheKey` must return an array or undefined"
|
|
294
293
|
},
|
|
295
294
|
|
|
296
|
-
|
|
295
|
+
66: {
|
|
297
296
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
298
297
|
condition: "evaledValue !== void 0",
|
|
299
298
|
message: "Invalid variable referenced in @%s directive."
|
|
300
299
|
},
|
|
301
300
|
|
|
302
|
-
|
|
301
|
+
67: {
|
|
303
302
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
304
303
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
305
304
|
message: "Incorrect number of arguments for the @%s directive."
|
|
306
305
|
},
|
|
307
306
|
|
|
308
|
-
|
|
307
|
+
68: {
|
|
309
308
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
310
309
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
311
310
|
message: "Invalid argument for the @%s directive."
|
|
312
311
|
},
|
|
313
312
|
|
|
314
|
-
|
|
313
|
+
69: {
|
|
315
314
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
316
315
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
317
316
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
318
317
|
},
|
|
319
318
|
|
|
320
|
-
|
|
319
|
+
70: {
|
|
321
320
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
322
321
|
|
|
323
322
|
message: "Found a %s operation%s. " +
|
|
324
323
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
325
324
|
},
|
|
326
325
|
|
|
327
|
-
|
|
326
|
+
71: {
|
|
328
327
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
329
328
|
condition: "fragments.length === 1",
|
|
330
329
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
331
330
|
},
|
|
332
331
|
|
|
333
|
-
|
|
332
|
+
72: {
|
|
334
333
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
335
334
|
condition: "fragment",
|
|
336
335
|
message: "No fragment named %s"
|
|
337
336
|
},
|
|
338
337
|
|
|
339
|
-
|
|
338
|
+
73: {
|
|
340
339
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
341
340
|
condition: "doc && doc.kind === \"Document\"",
|
|
342
341
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
343
342
|
},
|
|
344
343
|
|
|
345
|
-
|
|
344
|
+
74: {
|
|
346
345
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
347
346
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
348
347
|
},
|
|
349
348
|
|
|
350
|
-
|
|
349
|
+
75: {
|
|
351
350
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
352
351
|
condition: "operations.length <= 1",
|
|
353
352
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
354
353
|
},
|
|
355
354
|
|
|
356
|
-
|
|
355
|
+
76: {
|
|
357
356
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
358
357
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
359
358
|
message: "Must contain a query definition."
|
|
360
359
|
},
|
|
361
360
|
|
|
362
|
-
|
|
361
|
+
77: {
|
|
363
362
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
364
363
|
condition: "doc.kind === \"Document\"",
|
|
365
364
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
366
365
|
},
|
|
367
366
|
|
|
368
|
-
|
|
367
|
+
78: {
|
|
369
368
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
370
369
|
condition: "doc.definitions.length <= 1",
|
|
371
370
|
message: "Fragment must have exactly one definition."
|
|
372
371
|
},
|
|
373
372
|
|
|
374
|
-
|
|
373
|
+
79: {
|
|
375
374
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
376
375
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
377
376
|
message: "Must be a fragment definition."
|
|
378
377
|
},
|
|
379
378
|
|
|
380
|
-
|
|
379
|
+
80: {
|
|
381
380
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
382
381
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
383
382
|
},
|
|
384
383
|
|
|
385
|
-
|
|
384
|
+
81: {
|
|
386
385
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
387
386
|
|
|
388
387
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
@@ -392,12 +391,12 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
392
391
|
};
|
|
393
392
|
|
|
394
393
|
const devDebug = {
|
|
395
|
-
|
|
394
|
+
17: {
|
|
396
395
|
file: "@apollo/client/core/ApolloClient.js",
|
|
397
396
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
398
397
|
},
|
|
399
398
|
|
|
400
|
-
|
|
399
|
+
24: {
|
|
401
400
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
402
401
|
message: "Missing cache result fields: %o"
|
|
403
402
|
}
|
|
@@ -406,82 +405,97 @@ const devDebug = {
|
|
|
406
405
|
const devLog = {};
|
|
407
406
|
|
|
408
407
|
const devWarn = {
|
|
409
|
-
|
|
408
|
+
2: {
|
|
409
|
+
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
410
|
+
|
|
411
|
+
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
412
|
+
"Please make sure to set the `mergeIntoStore` parameter to `true` when creating a Reference that is not part of the store yet:\n" +
|
|
413
|
+
"`toReference(object, true)`"
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
3: {
|
|
417
|
+
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
418
|
+
|
|
419
|
+
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
420
|
+
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
6: {
|
|
410
424
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
411
425
|
message: "Inferring subtype %s of supertype %s"
|
|
412
426
|
},
|
|
413
427
|
|
|
414
|
-
|
|
428
|
+
7: {
|
|
415
429
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
416
430
|
message: "Undefined 'from' passed to readField with arguments %s"
|
|
417
431
|
},
|
|
418
432
|
|
|
419
|
-
|
|
433
|
+
14: {
|
|
420
434
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
421
435
|
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %s\n incoming: %s\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
|
|
422
436
|
},
|
|
423
437
|
|
|
424
|
-
|
|
438
|
+
20: {
|
|
425
439
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
426
440
|
message: "Called refetch(%o) for query %o, which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"
|
|
427
441
|
},
|
|
428
442
|
|
|
429
|
-
|
|
443
|
+
33: {
|
|
430
444
|
file: "@apollo/client/core/QueryManager.js",
|
|
431
445
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
432
446
|
},
|
|
433
447
|
|
|
434
|
-
|
|
448
|
+
34: {
|
|
435
449
|
file: "@apollo/client/core/QueryManager.js",
|
|
436
450
|
message: "Unknown query %s requested in refetchQueries options.include array"
|
|
437
451
|
},
|
|
438
452
|
|
|
439
|
-
|
|
453
|
+
35: {
|
|
440
454
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
441
455
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
442
456
|
},
|
|
443
457
|
|
|
444
|
-
|
|
458
|
+
38: {
|
|
445
459
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
446
460
|
message: "Multipart-subscriptions do not support @defer"
|
|
447
461
|
},
|
|
448
462
|
|
|
449
|
-
|
|
463
|
+
42: {
|
|
450
464
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
451
465
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
452
466
|
},
|
|
453
467
|
|
|
454
|
-
|
|
468
|
+
50: {
|
|
455
469
|
file: "@apollo/client/react/hooks/useQuery.js",
|
|
456
470
|
message: "Calling default no-op implementation of InternalState#forceUpdate"
|
|
457
471
|
},
|
|
458
472
|
|
|
459
|
-
|
|
473
|
+
52: {
|
|
460
474
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
461
475
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
462
476
|
},
|
|
463
477
|
|
|
464
|
-
|
|
478
|
+
53: {
|
|
465
479
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
466
480
|
message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
|
|
467
481
|
},
|
|
468
482
|
|
|
469
|
-
|
|
483
|
+
54: {
|
|
470
484
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
471
485
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
472
486
|
},
|
|
473
487
|
|
|
474
|
-
|
|
488
|
+
55: {
|
|
475
489
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
476
490
|
message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
|
|
477
491
|
},
|
|
478
492
|
|
|
479
|
-
|
|
493
|
+
57: {
|
|
480
494
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
481
495
|
message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
|
|
482
496
|
},
|
|
483
497
|
|
|
484
|
-
|
|
498
|
+
83: {
|
|
485
499
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
486
500
|
|
|
487
501
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
@@ -490,33 +504,33 @@ const devWarn = {
|
|
|
490
504
|
};
|
|
491
505
|
|
|
492
506
|
const devError = {
|
|
493
|
-
|
|
507
|
+
12: {
|
|
494
508
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
495
509
|
message: "Missing field '%s' while writing result %o"
|
|
496
510
|
},
|
|
497
511
|
|
|
498
|
-
|
|
512
|
+
21: {
|
|
499
513
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
500
514
|
message: "Unhandled GraphQL subscription error"
|
|
501
515
|
},
|
|
502
516
|
|
|
503
|
-
|
|
517
|
+
23: {
|
|
504
518
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
505
519
|
message: "Unhandled error"
|
|
506
520
|
},
|
|
507
521
|
|
|
508
|
-
|
|
522
|
+
58: {
|
|
509
523
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
510
524
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
511
525
|
},
|
|
512
526
|
|
|
513
|
-
|
|
527
|
+
82: {
|
|
514
528
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
515
529
|
message: "Could not find operation or fragment"
|
|
516
530
|
}
|
|
517
531
|
};
|
|
518
532
|
|
|
519
|
-
var version = "3.8.
|
|
533
|
+
var version = "3.8.6";
|
|
520
534
|
|
|
521
535
|
function maybe(thunk) {
|
|
522
536
|
try {
|
|
@@ -556,11 +570,14 @@ function wrap(fn) {
|
|
|
556
570
|
args[_i - 1] = arguments[_i];
|
|
557
571
|
}
|
|
558
572
|
if (typeof message === "number") {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
573
|
+
var arg0 = message;
|
|
574
|
+
message = getHandledErrorMsg(arg0);
|
|
575
|
+
if (!message) {
|
|
576
|
+
message = getFallbackErrorMsg(arg0, args);
|
|
577
|
+
args = [];
|
|
578
|
+
}
|
|
563
579
|
}
|
|
580
|
+
fn.apply(void 0, [message].concat(args));
|
|
564
581
|
};
|
|
565
582
|
}
|
|
566
583
|
Object.assign(function invariant(condition, message) {
|
|
@@ -569,7 +586,7 @@ Object.assign(function invariant(condition, message) {
|
|
|
569
586
|
args[_i - 2] = arguments[_i];
|
|
570
587
|
}
|
|
571
588
|
if (!condition) {
|
|
572
|
-
tsInvariant.invariant(condition,
|
|
589
|
+
tsInvariant.invariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));
|
|
573
590
|
}
|
|
574
591
|
}, {
|
|
575
592
|
debug: wrap(tsInvariant.invariant.debug),
|
|
@@ -578,20 +595,27 @@ Object.assign(function invariant(condition, message) {
|
|
|
578
595
|
error: wrap(tsInvariant.invariant.error),
|
|
579
596
|
});
|
|
580
597
|
var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
|
|
581
|
-
function
|
|
598
|
+
function stringify(arg) {
|
|
599
|
+
return typeof arg == "string"
|
|
600
|
+
? arg
|
|
601
|
+
: stringifyForDisplay(arg, 2).slice(0, 1000);
|
|
602
|
+
}
|
|
603
|
+
function getHandledErrorMsg(message, messageArgs) {
|
|
604
|
+
if (messageArgs === void 0) { messageArgs = []; }
|
|
605
|
+
if (!message)
|
|
606
|
+
return;
|
|
607
|
+
return (global$1[ApolloErrorMessageHandler] &&
|
|
608
|
+
global$1[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));
|
|
609
|
+
}
|
|
610
|
+
function getFallbackErrorMsg(message, messageArgs) {
|
|
582
611
|
if (messageArgs === void 0) { messageArgs = []; }
|
|
583
612
|
if (!message)
|
|
584
613
|
return;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
591
|
-
version: version,
|
|
592
|
-
message: message,
|
|
593
|
-
args: args,
|
|
594
|
-
}))));
|
|
614
|
+
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
615
|
+
version: version,
|
|
616
|
+
message: message,
|
|
617
|
+
args: messageArgs.map(stringify),
|
|
618
|
+
})));
|
|
595
619
|
}
|
|
596
620
|
|
|
597
621
|
function loadErrorMessageHandler() {
|
|
@@ -610,11 +634,11 @@ function loadErrorMessageHandler() {
|
|
|
610
634
|
function handler(message, args) {
|
|
611
635
|
if (typeof message === "number") {
|
|
612
636
|
var definition = globals.global[ApolloErrorMessageHandler][message];
|
|
613
|
-
if (!message || !definition.message)
|
|
637
|
+
if (!message || !(definition === null || definition === void 0 ? void 0 : definition.message))
|
|
614
638
|
return;
|
|
615
639
|
message = definition.message;
|
|
616
640
|
}
|
|
617
|
-
return args.reduce(function (msg, arg) { return msg.replace(
|
|
641
|
+
return args.reduce(function (msg, arg) { return msg.replace(/%[sdfo]/, String(arg)); }, String(message));
|
|
618
642
|
}
|
|
619
643
|
}
|
|
620
644
|
|