@apollo/client 3.8.0-beta.0 → 3.8.0-beta.2
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 +122 -131
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +1 -2
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +1 -2
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -2
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/core/ApolloClient.d.ts +1 -2
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +5 -5
- package/core/QueryManager.d.ts +1 -2
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +10 -11
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +19 -84
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +19 -84
- package/core/index.d.ts +1 -2
- package/core/index.d.ts.map +1 -1
- package/core/index.js +1 -2
- package/core/index.js.map +1 -1
- package/dev/dev.cjs +54 -54
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +54 -54
- package/invariantErrorCodes.js +53 -53
- 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/remove-typename/remove-typename.cjs +5 -6
- package/link/remove-typename/remove-typename.cjs.map +1 -1
- package/link/remove-typename/remove-typename.cjs.native.js +5 -6
- package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js +5 -6
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- 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 +11 -11
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.d.ts +2 -1
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +3 -12
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +5 -14
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +5 -14
- 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 +9 -9
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +9 -9
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.js +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseCache.js +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +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/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/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.d.ts.map +1 -0
- package/{core → utilities/graphql}/DocumentTransform.js +4 -3
- package/utilities/graphql/DocumentTransform.js.map +1 -0
- package/utilities/index.d.ts +1 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/utilities.cjs +86 -20
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +86 -20
- package/version.js +1 -1
- package/core/DocumentTransform.d.ts.map +0 -1
- package/core/DocumentTransform.js.map +0 -1
- /package/{core → utilities/graphql}/DocumentTransform.d.ts +0 -0
package/invariantErrorCodes.js
CHANGED
|
@@ -65,47 +65,41 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
65
65
|
},
|
|
66
66
|
|
|
67
67
|
17: {
|
|
68
|
-
file: "@apollo/client/core/DocumentTransform.js",
|
|
69
|
-
condition: "Array.isArray(cacheKeys)",
|
|
70
|
-
message: '`getCacheKey` must return an array or undefined'
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
18: {
|
|
74
68
|
file: "@apollo/client/core/LocalState.js",
|
|
75
69
|
condition: "fragment",
|
|
76
70
|
message: "No fragment named %s"
|
|
77
71
|
},
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
18: {
|
|
80
74
|
file: "@apollo/client/core/LocalState.js",
|
|
81
75
|
condition: "fragment",
|
|
82
76
|
message: "No fragment named %s"
|
|
83
77
|
},
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
21: {
|
|
86
80
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
87
81
|
condition: "pollInterval",
|
|
88
82
|
message: 'Attempted to start a polling query without a polling interval.'
|
|
89
83
|
},
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
24: {
|
|
92
86
|
file: "@apollo/client/core/QueryManager.js",
|
|
93
87
|
message: 'QueryManager stopped while query was in flight'
|
|
94
88
|
},
|
|
95
89
|
|
|
96
|
-
|
|
90
|
+
25: {
|
|
97
91
|
file: "@apollo/client/core/QueryManager.js",
|
|
98
92
|
condition: "mutation",
|
|
99
93
|
message: 'mutation option is required. You must specify your GraphQL document in the mutation option.'
|
|
100
94
|
},
|
|
101
95
|
|
|
102
|
-
|
|
96
|
+
26: {
|
|
103
97
|
file: "@apollo/client/core/QueryManager.js",
|
|
104
98
|
condition: "fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache'",
|
|
105
99
|
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."
|
|
106
100
|
},
|
|
107
101
|
|
|
108
|
-
|
|
102
|
+
27: {
|
|
109
103
|
file: "@apollo/client/core/QueryManager.js",
|
|
110
104
|
condition: "options.query",
|
|
111
105
|
|
|
@@ -113,45 +107,45 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
113
107
|
'in the query option.'
|
|
114
108
|
},
|
|
115
109
|
|
|
116
|
-
|
|
110
|
+
28: {
|
|
117
111
|
file: "@apollo/client/core/QueryManager.js",
|
|
118
112
|
condition: "options.query.kind === 'Document'",
|
|
119
113
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
120
114
|
},
|
|
121
115
|
|
|
122
|
-
|
|
116
|
+
29: {
|
|
123
117
|
file: "@apollo/client/core/QueryManager.js",
|
|
124
118
|
condition: "!options.returnPartialData",
|
|
125
119
|
message: 'returnPartialData option only supported on watchQuery.'
|
|
126
120
|
},
|
|
127
121
|
|
|
128
|
-
|
|
122
|
+
30: {
|
|
129
123
|
file: "@apollo/client/core/QueryManager.js",
|
|
130
124
|
condition: "!options.pollInterval",
|
|
131
125
|
message: 'pollInterval option only supported on watchQuery.'
|
|
132
126
|
},
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
31: {
|
|
135
129
|
file: "@apollo/client/core/QueryManager.js",
|
|
136
130
|
message: 'Store reset while query was in flight (not completed in link chain)'
|
|
137
131
|
},
|
|
138
132
|
|
|
139
|
-
|
|
133
|
+
35: {
|
|
140
134
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
141
135
|
message: 'request is not implemented'
|
|
142
136
|
},
|
|
143
137
|
|
|
144
|
-
|
|
138
|
+
36: {
|
|
145
139
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
146
140
|
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 "
|
|
147
141
|
},
|
|
148
142
|
|
|
149
|
-
|
|
143
|
+
38: {
|
|
150
144
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
151
145
|
message: "Network request failed. %s is not serializable: %s"
|
|
152
146
|
},
|
|
153
147
|
|
|
154
|
-
|
|
148
|
+
39: {
|
|
155
149
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
156
150
|
condition: "options && (typeof options.sha256 === 'function' ||\n typeof options.generateHash === 'function')",
|
|
157
151
|
|
|
@@ -160,18 +154,18 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
160
154
|
'parameter.'
|
|
161
155
|
},
|
|
162
156
|
|
|
163
|
-
|
|
157
|
+
40: {
|
|
164
158
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
165
159
|
condition: "forward",
|
|
166
160
|
message: 'PersistedQueryLink cannot be the last link in the chain.'
|
|
167
161
|
},
|
|
168
162
|
|
|
169
|
-
|
|
163
|
+
42: {
|
|
170
164
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
171
165
|
message: "illegal argument: %s"
|
|
172
166
|
},
|
|
173
167
|
|
|
174
|
-
|
|
168
|
+
43: {
|
|
175
169
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
176
170
|
condition: "context && context.client",
|
|
177
171
|
|
|
@@ -179,7 +173,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
179
173
|
'Wrap the root component in an <ApolloProvider>.'
|
|
180
174
|
},
|
|
181
175
|
|
|
182
|
-
|
|
176
|
+
44: {
|
|
183
177
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
184
178
|
condition: "'createContext' in React",
|
|
185
179
|
|
|
@@ -189,7 +183,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
189
183
|
'For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components'
|
|
190
184
|
},
|
|
191
185
|
|
|
192
|
-
|
|
186
|
+
45: {
|
|
193
187
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
194
188
|
condition: "context.client",
|
|
195
189
|
|
|
@@ -197,7 +191,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
197
191
|
'sure you pass in your client via the "client" prop.'
|
|
198
192
|
},
|
|
199
193
|
|
|
200
|
-
|
|
194
|
+
46: {
|
|
201
195
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
202
196
|
condition: "this.withRef",
|
|
203
197
|
|
|
@@ -205,7 +199,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
205
199
|
"{ withRef: true } in the options"
|
|
206
200
|
},
|
|
207
201
|
|
|
208
|
-
|
|
202
|
+
47: {
|
|
209
203
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
210
204
|
condition: "operationOptions.withRef",
|
|
211
205
|
|
|
@@ -213,7 +207,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
213
207
|
"{ withRef: true } in the options"
|
|
214
208
|
},
|
|
215
209
|
|
|
216
|
-
|
|
210
|
+
48: {
|
|
217
211
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
218
212
|
condition: "!!client",
|
|
219
213
|
|
|
@@ -222,7 +216,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
222
216
|
'instance in via options.'
|
|
223
217
|
},
|
|
224
218
|
|
|
225
|
-
|
|
219
|
+
49: {
|
|
226
220
|
file: "@apollo/client/react/hooks/useBackgroundQuery.js",
|
|
227
221
|
condition: "queryRef.promiseCache",
|
|
228
222
|
|
|
@@ -231,7 +225,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
231
225
|
'Please ensure you are passing the `queryRef` returned from `useBackgroundQuery`.'
|
|
232
226
|
},
|
|
233
227
|
|
|
234
|
-
|
|
228
|
+
55: {
|
|
235
229
|
file: "@apollo/client/react/hooks/useSuspenseCache.js",
|
|
236
230
|
condition: "suspenseCache",
|
|
237
231
|
|
|
@@ -240,13 +234,13 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
240
234
|
'or pass a SuspenseCache instance in via options.'
|
|
241
235
|
},
|
|
242
236
|
|
|
243
|
-
|
|
237
|
+
56: {
|
|
244
238
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
245
239
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
246
240
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
247
241
|
},
|
|
248
242
|
|
|
249
|
-
|
|
243
|
+
59: {
|
|
250
244
|
file: "@apollo/client/react/parser/index.js",
|
|
251
245
|
condition: "!!document && !!document.kind",
|
|
252
246
|
|
|
@@ -255,7 +249,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
255
249
|
"to convert your operation into a document"
|
|
256
250
|
},
|
|
257
251
|
|
|
258
|
-
|
|
252
|
+
60: {
|
|
259
253
|
file: "@apollo/client/react/parser/index.js",
|
|
260
254
|
condition: "!fragments.length ||\n (queries.length || mutations.length || subscriptions.length)",
|
|
261
255
|
|
|
@@ -263,7 +257,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
263
257
|
"You must include a query, subscription or mutation as well"
|
|
264
258
|
},
|
|
265
259
|
|
|
266
|
-
|
|
260
|
+
61: {
|
|
267
261
|
file: "@apollo/client/react/parser/index.js",
|
|
268
262
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
269
263
|
|
|
@@ -273,7 +267,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
273
267
|
"You can use 'compose' to join multiple operation types to a component"
|
|
274
268
|
},
|
|
275
269
|
|
|
276
|
-
|
|
270
|
+
62: {
|
|
277
271
|
file: "@apollo/client/react/parser/index.js",
|
|
278
272
|
condition: "definitions.length === 1",
|
|
279
273
|
|
|
@@ -282,7 +276,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
282
276
|
"You can use 'compose' to join multiple operation types to a component"
|
|
283
277
|
},
|
|
284
278
|
|
|
285
|
-
|
|
279
|
+
63: {
|
|
286
280
|
file: "@apollo/client/react/parser/index.js",
|
|
287
281
|
condition: "operation.type === type",
|
|
288
282
|
|
|
@@ -290,12 +284,18 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
290
284
|
"%s, but a %s was used instead."
|
|
291
285
|
},
|
|
292
286
|
|
|
293
|
-
|
|
287
|
+
64: {
|
|
294
288
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
295
289
|
condition: "queryWithoutConnection",
|
|
296
290
|
message: "query is required"
|
|
297
291
|
},
|
|
298
292
|
|
|
293
|
+
65: {
|
|
294
|
+
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
295
|
+
condition: "Array.isArray(cacheKeys)",
|
|
296
|
+
message: '`getCacheKey` must return an array or undefined'
|
|
297
|
+
},
|
|
298
|
+
|
|
299
299
|
66: {
|
|
300
300
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
301
301
|
condition: "evaledValue !== void 0",
|
|
@@ -400,7 +400,7 @@ export const devDebug = {
|
|
|
400
400
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
401
401
|
},
|
|
402
402
|
|
|
403
|
-
|
|
403
|
+
23: {
|
|
404
404
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
405
405
|
message: "Missing cache result fields: %o"
|
|
406
406
|
}
|
|
@@ -431,62 +431,62 @@ export const devWarn = {
|
|
|
431
431
|
message: "Cache data may be lost when replacing the %s field of a %s object.\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"
|
|
432
432
|
},
|
|
433
433
|
|
|
434
|
-
|
|
434
|
+
19: {
|
|
435
435
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
436
436
|
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 })?"
|
|
437
437
|
},
|
|
438
438
|
|
|
439
|
-
|
|
439
|
+
32: {
|
|
440
440
|
file: "@apollo/client/core/QueryManager.js",
|
|
441
441
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
442
442
|
},
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
33: {
|
|
445
445
|
file: "@apollo/client/core/QueryManager.js",
|
|
446
446
|
message: "Unknown query %s requested in refetchQueries options.include array"
|
|
447
447
|
},
|
|
448
448
|
|
|
449
|
-
|
|
449
|
+
34: {
|
|
450
450
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
451
451
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
452
452
|
},
|
|
453
453
|
|
|
454
|
-
|
|
454
|
+
37: {
|
|
455
455
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
456
456
|
message: "Multipart-subscriptions do not support @defer"
|
|
457
457
|
},
|
|
458
458
|
|
|
459
|
-
|
|
459
|
+
41: {
|
|
460
460
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
461
461
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
462
462
|
},
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
50: {
|
|
465
465
|
file: "@apollo/client/react/hooks/useQuery.js",
|
|
466
466
|
message: "Calling default no-op implementation of InternalState#forceUpdate"
|
|
467
467
|
},
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
51: {
|
|
470
470
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
471
471
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
472
472
|
},
|
|
473
473
|
|
|
474
|
-
|
|
474
|
+
52: {
|
|
475
475
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
476
476
|
message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
|
|
477
477
|
},
|
|
478
478
|
|
|
479
|
-
|
|
479
|
+
53: {
|
|
480
480
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
481
481
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
482
482
|
},
|
|
483
483
|
|
|
484
|
-
|
|
484
|
+
54: {
|
|
485
485
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
486
486
|
message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
|
|
487
487
|
},
|
|
488
488
|
|
|
489
|
-
|
|
489
|
+
57: {
|
|
490
490
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
491
491
|
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.'
|
|
492
492
|
},
|
|
@@ -505,17 +505,17 @@ export const devError = {
|
|
|
505
505
|
message: "Missing field '%s' while writing result %o"
|
|
506
506
|
},
|
|
507
507
|
|
|
508
|
-
|
|
508
|
+
20: {
|
|
509
509
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
510
510
|
message: 'Unhandled GraphQL subscription error'
|
|
511
511
|
},
|
|
512
512
|
|
|
513
|
-
|
|
513
|
+
22: {
|
|
514
514
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
515
515
|
message: 'Unhandled error'
|
|
516
516
|
},
|
|
517
517
|
|
|
518
|
-
|
|
518
|
+
58: {
|
|
519
519
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
520
520
|
message: 'The result of getSnapshot should be cached to avoid an infinite loop'
|
|
521
521
|
},
|
package/link/core/ApolloLink.js
CHANGED
|
@@ -47,7 +47,7 @@ var ApolloLink = (function () {
|
|
|
47
47
|
ApolloLink.concat = function (first, second) {
|
|
48
48
|
var firstLink = toLink(first);
|
|
49
49
|
if (isTerminating(firstLink)) {
|
|
50
|
-
__DEV__ && invariant.warn(
|
|
50
|
+
__DEV__ && invariant.warn(34, firstLink);
|
|
51
51
|
return firstLink;
|
|
52
52
|
}
|
|
53
53
|
var nextLink = toLink(second);
|
|
@@ -71,7 +71,7 @@ var ApolloLink = (function () {
|
|
|
71
71
|
return ApolloLink.concat(this, next);
|
|
72
72
|
};
|
|
73
73
|
ApolloLink.prototype.request = function (operation, forward) {
|
|
74
|
-
throw newInvariantError(
|
|
74
|
+
throw newInvariantError(35);
|
|
75
75
|
};
|
|
76
76
|
ApolloLink.prototype.onError = function (error, observer) {
|
|
77
77
|
if (observer && observer.error) {
|
package/link/core/core.cjs
CHANGED
|
@@ -52,7 +52,7 @@ var ApolloLink = (function () {
|
|
|
52
52
|
ApolloLink.concat = function (first, second) {
|
|
53
53
|
var firstLink = toLink(first);
|
|
54
54
|
if (isTerminating(firstLink)) {
|
|
55
|
-
globals.__DEV__ && globals.invariant.warn(
|
|
55
|
+
globals.__DEV__ && globals.invariant.warn(34, firstLink);
|
|
56
56
|
return firstLink;
|
|
57
57
|
}
|
|
58
58
|
var nextLink = toLink(second);
|
|
@@ -76,7 +76,7 @@ var ApolloLink = (function () {
|
|
|
76
76
|
return ApolloLink.concat(this, next);
|
|
77
77
|
};
|
|
78
78
|
ApolloLink.prototype.request = function (operation, forward) {
|
|
79
|
-
throw globals.newInvariantError(
|
|
79
|
+
throw globals.newInvariantError(35);
|
|
80
80
|
};
|
|
81
81
|
ApolloLink.prototype.onError = function (error, observer) {
|
|
82
82
|
if (observer && observer.error) {
|
package/link/core/core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.cjs","sources":["ApolloLink.js","empty.js","from.js","split.js","concat.js","execute.js"],"sourcesContent":["import { newInvariantError, invariant, __DEV__ } from '../../utilities/globals';\nimport { Observable } from '../../utilities';\nimport { validateOperation, createOperation, transformOperation, } from '../utils';\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n __DEV__ && invariant.warn(
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["ApolloLink.js","empty.js","from.js","split.js","concat.js","execute.js"],"sourcesContent":["import { newInvariantError, invariant, __DEV__ } from '../../utilities/globals';\nimport { Observable } from '../../utilities';\nimport { validateOperation, createOperation, transformOperation, } from '../utils';\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n __DEV__ && invariant.warn(34, firstLink);\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw newInvariantError(35);\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","import { ApolloLink } from './ApolloLink';\nexport var empty = ApolloLink.empty;\n//# sourceMappingURL=empty.js.map","import { ApolloLink } from './ApolloLink';\nexport var from = ApolloLink.from;\n//# sourceMappingURL=from.js.map","import { ApolloLink } from './ApolloLink';\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from './ApolloLink';\nexport var concat = ApolloLink.concat;\n//# sourceMappingURL=concat.js.map","import { ApolloLink } from './ApolloLink';\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map"],"names":["Observable","createOperation","transformOperation","validateOperation","__DEV__","invariant","newInvariantError"],"mappings":";;;;;;;;AAGA,SAAS,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE;AAClC,IAAI,QAAQ,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,GAAGA,oBAAU,CAAC,EAAE,EAAE,EAAE;AACrD,CAAC;AACD,SAAS,MAAM,CAAC,OAAO,EAAE;AACzB,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAC7E,CAAC;AACD,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;AACpC,CAAC;AACE,IAAC,UAAU,IAAI,YAAY;AAC9B,IAAI,SAAS,UAAU,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,OAAO;AACnB,YAAY,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACnC,KAAK;AACL,IAAI,UAAU,CAAC,KAAK,GAAG,YAAY;AACnC,QAAQ,OAAO,IAAI,UAA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EAAE;AACpD,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;AAC1B,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK,CAAC;AACN,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,EAAE;;ACtFO,IAAC,KAAK,GAAG,UAAU,CAAC;;ACApB,IAAC,IAAI,GAAG,UAAU,CAAC;;ACAnB,IAAC,KAAK,GAAG,UAAU,CAAC;;ACApB,IAAC,MAAM,GAAG,UAAU,CAAC;;ACArB,IAAC,OAAO,GAAG,UAAU,CAAC;;;;;;;;;"}
|
|
@@ -52,7 +52,7 @@ var ApolloLink = (function () {
|
|
|
52
52
|
ApolloLink.concat = function (first, second) {
|
|
53
53
|
var firstLink = toLink(first);
|
|
54
54
|
if (isTerminating(firstLink)) {
|
|
55
|
-
globals.__DEV__ && globals.invariant.warn(
|
|
55
|
+
globals.__DEV__ && globals.invariant.warn(34, firstLink);
|
|
56
56
|
return firstLink;
|
|
57
57
|
}
|
|
58
58
|
var nextLink = toLink(second);
|
|
@@ -76,7 +76,7 @@ var ApolloLink = (function () {
|
|
|
76
76
|
return ApolloLink.concat(this, next);
|
|
77
77
|
};
|
|
78
78
|
ApolloLink.prototype.request = function (operation, forward) {
|
|
79
|
-
throw globals.newInvariantError(
|
|
79
|
+
throw globals.newInvariantError(35);
|
|
80
80
|
};
|
|
81
81
|
ApolloLink.prototype.onError = function (error, observer) {
|
|
82
82
|
if (observer && observer.error) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { newInvariantError } from "../../utilities/globals/index.js";
|
|
2
2
|
export var checkFetcher = function (fetcher) {
|
|
3
3
|
if (!fetcher && typeof fetch === 'undefined') {
|
|
4
|
-
throw newInvariantError(
|
|
4
|
+
throw newInvariantError(36);
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=checkFetcher.js.map
|
|
@@ -78,7 +78,7 @@ export var createHttpLink = function (linkOptions) {
|
|
|
78
78
|
options.headers = options.headers || {};
|
|
79
79
|
var acceptHeader = "multipart/mixed;";
|
|
80
80
|
if (isSubscription && hasDefer) {
|
|
81
|
-
__DEV__ && invariant.warn(
|
|
81
|
+
__DEV__ && invariant.warn(37);
|
|
82
82
|
}
|
|
83
83
|
if (isSubscription) {
|
|
84
84
|
acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
|
package/link/http/http.cjs
CHANGED
|
@@ -331,7 +331,7 @@ var serializeFetchParameter = function (p, label) {
|
|
|
331
331
|
serialized = JSON.stringify(p);
|
|
332
332
|
}
|
|
333
333
|
catch (e) {
|
|
334
|
-
var parseError = globals.newInvariantError(
|
|
334
|
+
var parseError = globals.newInvariantError(38, label, e.message);
|
|
335
335
|
parseError.parseError = e;
|
|
336
336
|
throw parseError;
|
|
337
337
|
}
|
|
@@ -414,7 +414,7 @@ function removeDuplicateHeaders(headers, preserveHeaderCase) {
|
|
|
414
414
|
|
|
415
415
|
var checkFetcher = function (fetcher) {
|
|
416
416
|
if (!fetcher && typeof fetch === 'undefined') {
|
|
417
|
-
throw globals.newInvariantError(
|
|
417
|
+
throw globals.newInvariantError(36);
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
420
|
|
|
@@ -549,7 +549,7 @@ var createHttpLink = function (linkOptions) {
|
|
|
549
549
|
options.headers = options.headers || {};
|
|
550
550
|
var acceptHeader = "multipart/mixed;";
|
|
551
551
|
if (isSubscription && hasDefer) {
|
|
552
|
-
globals.__DEV__ && globals.invariant.warn(
|
|
552
|
+
globals.__DEV__ && globals.invariant.warn(37);
|
|
553
553
|
}
|
|
554
554
|
if (isSubscription) {
|
|
555
555
|
acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
|