@apollo/client 4.0.0-alpha.20 → 4.0.0-alpha.21
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 +10 -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 +10 -10
- 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 +75 -256
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +4 -36
- 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/invariantErrorCodes.cjs +64 -69
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +10 -10
- package/__cjs/masking/maskDefinition.cjs.map +1 -1
- package/__cjs/masking/maskFragment.cjs +0 -8
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskOperation.cjs +0 -8
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/utils.cjs +3 -11
- package/__cjs/masking/utils.cjs.map +1 -1
- package/__cjs/masking/utils.d.cts +0 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +0 -8
- 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/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.js +10 -10
- 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 +4 -36
- package/core/QueryManager.js +77 -258
- package/core/QueryManager.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/invariantErrorCodes.js +64 -69
- package/link/core/ApolloLink.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/local-state/LocalState.js +10 -10
- package/masking/maskDefinition.js.map +1 -1
- package/masking/maskFragment.js +0 -8
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.js +0 -8
- package/masking/maskOperation.js.map +1 -1
- package/masking/utils.d.ts +0 -1
- package/masking/utils.js +3 -10
- package/masking/utils.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useLazyQuery.d.ts +0 -8
- package/react/hooks/useLazyQuery.js +1 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/utilities/index.d.ts +0 -13
- package/utilities/index.js +0 -12
- package/utilities/index.js.map +1 -1
- package/version.js +1 -1
package/core/networkStatus.d.ts
CHANGED
|
@@ -36,7 +36,13 @@ export declare enum NetworkStatus {
|
|
|
36
36
|
/**
|
|
37
37
|
* No request is in flight for this query, but one or more errors were detected.
|
|
38
38
|
*/
|
|
39
|
-
error = 8
|
|
39
|
+
error = 8,
|
|
40
|
+
/**
|
|
41
|
+
* Indicates that a `@defer` query has received at least the first chunk of
|
|
42
|
+
* the result but the full result has not yet been fully streamed to the
|
|
43
|
+
* client.
|
|
44
|
+
*/
|
|
45
|
+
streaming = 9
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* Returns true if there is currently a network request in flight according to a given network
|
package/core/networkStatus.js
CHANGED
|
@@ -38,13 +38,19 @@ export var NetworkStatus;
|
|
|
38
38
|
* No request is in flight for this query, but one or more errors were detected.
|
|
39
39
|
*/
|
|
40
40
|
NetworkStatus[NetworkStatus["error"] = 8] = "error";
|
|
41
|
+
/**
|
|
42
|
+
* Indicates that a `@defer` query has received at least the first chunk of
|
|
43
|
+
* the result but the full result has not yet been fully streamed to the
|
|
44
|
+
* client.
|
|
45
|
+
*/
|
|
46
|
+
NetworkStatus[NetworkStatus["streaming"] = 9] = "streaming";
|
|
41
47
|
})(NetworkStatus || (NetworkStatus = {}));
|
|
42
48
|
/**
|
|
43
49
|
* Returns true if there is currently a network request in flight according to a given network
|
|
44
50
|
* status.
|
|
45
51
|
*/
|
|
46
52
|
export function isNetworkRequestInFlight(networkStatus) {
|
|
47
|
-
return networkStatus
|
|
53
|
+
return !isNetworkRequestSettled(networkStatus);
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* Returns true if the network request is in ready or error state according to a given network
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networkStatus.js","sources":["../../src/core/networkStatus.ts"],"sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus?: NetworkStatus\n): boolean {\n return networkStatus
|
|
1
|
+
{"version":3,"file":"networkStatus.js","sources":["../../src/core/networkStatus.ts"],"sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n\n /**\n * Indicates that a `@defer` query has received at least the first chunk of\n * the result but the full result has not yet been fully streamed to the\n * client.\n */\n streaming = 9,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus?: NetworkStatus\n): boolean {\n return !isNetworkRequestSettled(networkStatus);\n}\n\n/**\n * Returns true if the network request is in ready or error state according to a given network\n * status.\n */\nexport function isNetworkRequestSettled(\n networkStatus?: NetworkStatus\n): boolean {\n return networkStatus === 7 || networkStatus === 8;\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA;;CAEA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAiDC;AAjDD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAY,CAAZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB,EAAzB;IACE,CAAF,CAAA;;;;KAIA,CAAA;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa;IAEX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AAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAA2B,EAA3B,CAAA,EAAgC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAkD,CAAC;AACnD;"}
|
package/invariantErrorCodes.js
CHANGED
|
@@ -257,47 +257,47 @@ you have an infinite render loop in your application.`
|
|
|
257
257
|
message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
|
|
258
258
|
},
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
47: {
|
|
261
261
|
file: "@apollo/client/local-state/LocalState.js",
|
|
262
262
|
condition: "hasDirectives([\"client\"], document)",
|
|
263
263
|
message: "Expected document to contain `@client` fields."
|
|
264
264
|
},
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
48: {
|
|
267
267
|
file: "@apollo/client/local-state/LocalState.js",
|
|
268
268
|
condition: "hasDirectives([\"client\"], document)",
|
|
269
269
|
message: "Expected document to contain `@client` fields."
|
|
270
270
|
},
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
49: {
|
|
273
273
|
file: "@apollo/client/local-state/LocalState.js",
|
|
274
274
|
condition: "fragment",
|
|
275
275
|
message: "No fragment named %s"
|
|
276
276
|
},
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
54: {
|
|
279
279
|
file: "@apollo/client/local-state/LocalState.js",
|
|
280
280
|
message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
|
|
281
281
|
},
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
55: {
|
|
284
284
|
file: "@apollo/client/local-state/LocalState.js",
|
|
285
285
|
condition: "fragment",
|
|
286
286
|
message: `No fragment named %s`
|
|
287
287
|
},
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
56: {
|
|
290
290
|
file: "@apollo/client/local-state/LocalState.js",
|
|
291
291
|
condition: "cache.fragmentMatches",
|
|
292
292
|
message: "The configured cache does not support fragment matching which will lead to incorrect results when executing local resolvers. Please use a cache that implements `fragmetMatches`."
|
|
293
293
|
},
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
57: {
|
|
296
296
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
297
297
|
message: `illegal argument: %s`
|
|
298
298
|
},
|
|
299
299
|
|
|
300
|
-
|
|
300
|
+
58: {
|
|
301
301
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
302
302
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
303
303
|
|
|
@@ -306,13 +306,13 @@ you have an infinite render loop in your application.`
|
|
|
306
306
|
"parameter."
|
|
307
307
|
},
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
59: {
|
|
310
310
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
311
311
|
condition: "forward",
|
|
312
312
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
313
313
|
},
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
60: {
|
|
316
316
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
317
317
|
condition: "fetcher || typeof fetch !== \"undefined\"",
|
|
318
318
|
|
|
@@ -330,23 +330,23 @@ const client = new ApolloClient({
|
|
|
330
330
|
`
|
|
331
331
|
},
|
|
332
332
|
|
|
333
|
-
|
|
333
|
+
62: {
|
|
334
334
|
file: "@apollo/client/link/http/parseAndCheckHttpResponse.js",
|
|
335
335
|
condition: "response.body && typeof response.body.getReader === \"function\"",
|
|
336
336
|
message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
|
|
337
337
|
},
|
|
338
338
|
|
|
339
|
-
|
|
339
|
+
63: {
|
|
340
340
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
341
341
|
message: `Network request failed. %s is not serializable: %s`
|
|
342
342
|
},
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
65: {
|
|
345
345
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
346
346
|
message: "request is not implemented"
|
|
347
347
|
},
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
66: {
|
|
350
350
|
file: "@apollo/client/core/ApolloClient.js",
|
|
351
351
|
condition: "options.cache",
|
|
352
352
|
|
|
@@ -355,7 +355,7 @@ const client = new ApolloClient({
|
|
|
355
355
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
356
356
|
},
|
|
357
357
|
|
|
358
|
-
|
|
358
|
+
67: {
|
|
359
359
|
file: "@apollo/client/core/ApolloClient.js",
|
|
360
360
|
condition: "options.link",
|
|
361
361
|
|
|
@@ -364,7 +364,7 @@ const client = new ApolloClient({
|
|
|
364
364
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
365
365
|
},
|
|
366
366
|
|
|
367
|
-
|
|
367
|
+
68: {
|
|
368
368
|
file: "@apollo/client/core/ApolloClient.js",
|
|
369
369
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
370
370
|
|
|
@@ -374,7 +374,7 @@ const client = new ApolloClient({
|
|
|
374
374
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
375
375
|
},
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
69: {
|
|
378
378
|
file: "@apollo/client/core/ApolloClient.js",
|
|
379
379
|
condition: "options.fetchPolicy !== \"standby\"",
|
|
380
380
|
|
|
@@ -383,7 +383,7 @@ const client = new ApolloClient({
|
|
|
383
383
|
"as cache-first or network-only."
|
|
384
384
|
},
|
|
385
385
|
|
|
386
|
-
|
|
386
|
+
70: {
|
|
387
387
|
file: "@apollo/client/core/ApolloClient.js",
|
|
388
388
|
condition: "options.query",
|
|
389
389
|
|
|
@@ -391,152 +391,152 @@ const client = new ApolloClient({
|
|
|
391
391
|
"in the query option."
|
|
392
392
|
},
|
|
393
393
|
|
|
394
|
-
|
|
394
|
+
71: {
|
|
395
395
|
file: "@apollo/client/core/ApolloClient.js",
|
|
396
396
|
condition: "options.query.kind === \"Document\"",
|
|
397
397
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
398
398
|
},
|
|
399
399
|
|
|
400
|
-
|
|
400
|
+
72: {
|
|
401
401
|
file: "@apollo/client/core/ApolloClient.js",
|
|
402
402
|
condition: "!options.returnPartialData",
|
|
403
403
|
message: "returnPartialData option only supported on watchQuery."
|
|
404
404
|
},
|
|
405
405
|
|
|
406
|
-
|
|
406
|
+
73: {
|
|
407
407
|
file: "@apollo/client/core/ApolloClient.js",
|
|
408
408
|
condition: "!options.pollInterval",
|
|
409
409
|
message: "pollInterval option only supported on watchQuery."
|
|
410
410
|
},
|
|
411
411
|
|
|
412
|
-
|
|
412
|
+
74: {
|
|
413
413
|
file: "@apollo/client/core/ApolloClient.js",
|
|
414
414
|
condition: "!options.notifyOnNetworkStatusChange",
|
|
415
415
|
message: "notifyOnNetworkStatusChange option only supported on watchQuery."
|
|
416
416
|
},
|
|
417
417
|
|
|
418
|
-
|
|
418
|
+
77: {
|
|
419
419
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
420
420
|
condition: "updateQuery",
|
|
421
421
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
422
422
|
},
|
|
423
423
|
|
|
424
|
-
|
|
424
|
+
79: {
|
|
425
425
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
426
426
|
condition: "pollInterval",
|
|
427
427
|
message: "Attempted to start a polling query without a polling interval."
|
|
428
428
|
},
|
|
429
429
|
|
|
430
|
-
|
|
430
|
+
81: {
|
|
431
431
|
file: "@apollo/client/core/QueryManager.js",
|
|
432
432
|
message: "QueryManager stopped while query was in flight"
|
|
433
433
|
},
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
82: {
|
|
436
436
|
file: "@apollo/client/core/QueryManager.js",
|
|
437
437
|
condition: "mutation",
|
|
438
438
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
439
439
|
},
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
83: {
|
|
442
442
|
file: "@apollo/client/core/QueryManager.js",
|
|
443
443
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
444
444
|
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."
|
|
445
445
|
},
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
84: {
|
|
448
448
|
file: "@apollo/client/core/QueryManager.js",
|
|
449
449
|
condition: "this.localState",
|
|
450
450
|
message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
451
451
|
},
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
85: {
|
|
454
454
|
file: "@apollo/client/core/QueryManager.js",
|
|
455
455
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
456
456
|
},
|
|
457
457
|
|
|
458
|
-
|
|
458
|
+
88: {
|
|
459
459
|
file: "@apollo/client/core/QueryManager.js",
|
|
460
460
|
condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
|
|
461
461
|
message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
462
462
|
},
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
89: {
|
|
465
465
|
file: "@apollo/client/core/QueryManager.js",
|
|
466
466
|
condition: "this.localState",
|
|
467
467
|
message: "%s '%s' contains `@client` fields but local state has not been configured."
|
|
468
468
|
},
|
|
469
469
|
|
|
470
|
-
|
|
470
|
+
90: {
|
|
471
471
|
file: "@apollo/client/core/QueryManager.js",
|
|
472
472
|
condition: "this.localState",
|
|
473
473
|
message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
474
474
|
},
|
|
475
475
|
|
|
476
|
-
|
|
476
|
+
92: {
|
|
477
477
|
file: "@apollo/client/core/QueryManager.js",
|
|
478
478
|
condition: "this.localState",
|
|
479
479
|
message: "Query '%s' contains `@client` fields but local state has not been configured."
|
|
480
480
|
},
|
|
481
481
|
|
|
482
|
-
|
|
482
|
+
93: {
|
|
483
483
|
file: "@apollo/client/core/QueryManager.js",
|
|
484
484
|
condition: "didEmitValue",
|
|
485
485
|
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
486
486
|
},
|
|
487
487
|
|
|
488
|
-
|
|
488
|
+
94: {
|
|
489
489
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
490
490
|
condition: "typeof dataId === \"string\"",
|
|
491
491
|
message: "store.merge expects a string ID"
|
|
492
492
|
},
|
|
493
493
|
|
|
494
|
-
|
|
494
|
+
97: {
|
|
495
495
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
496
496
|
condition: "extracted !== void 0",
|
|
497
497
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
498
498
|
},
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
98: {
|
|
501
501
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
502
502
|
condition: "!old || old === which",
|
|
503
503
|
message: `Cannot change root %s __typename more than once`
|
|
504
504
|
},
|
|
505
505
|
|
|
506
|
-
|
|
506
|
+
101: {
|
|
507
507
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
508
508
|
message: "Cannot automatically merge arrays"
|
|
509
509
|
},
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
102: {
|
|
512
512
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
513
513
|
message: `No fragment named %s`
|
|
514
514
|
},
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
103: {
|
|
517
517
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
518
518
|
condition: "!isReference(value)",
|
|
519
519
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
520
520
|
},
|
|
521
521
|
|
|
522
|
-
|
|
522
|
+
104: {
|
|
523
523
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
524
524
|
message: `Could not identify object %s`
|
|
525
525
|
},
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
106: {
|
|
528
528
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
529
529
|
message: `No fragment named %s`
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
532
|
|
|
533
533
|
export const devDebug = {
|
|
534
|
-
|
|
534
|
+
75: {
|
|
535
535
|
file: "@apollo/client/core/ApolloClient.js",
|
|
536
536
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
537
537
|
},
|
|
538
538
|
|
|
539
|
-
|
|
539
|
+
80: {
|
|
540
540
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
541
541
|
message: `Missing cache result fields: %o`
|
|
542
542
|
}
|
|
@@ -556,78 +556,73 @@ export const devWarn = {
|
|
|
556
556
|
},
|
|
557
557
|
|
|
558
558
|
44: {
|
|
559
|
-
file: "@apollo/client/masking/utils.js",
|
|
560
|
-
message: "The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning."
|
|
561
|
-
},
|
|
562
|
-
|
|
563
|
-
45: {
|
|
564
559
|
file: "@apollo/client/masking/utils.js",
|
|
565
560
|
message: "@unmask 'mode' argument does not support variables."
|
|
566
561
|
},
|
|
567
562
|
|
|
568
|
-
|
|
563
|
+
45: {
|
|
569
564
|
file: "@apollo/client/masking/utils.js",
|
|
570
565
|
message: "@unmask 'mode' argument must be of type string."
|
|
571
566
|
},
|
|
572
567
|
|
|
573
|
-
|
|
568
|
+
46: {
|
|
574
569
|
file: "@apollo/client/masking/utils.js",
|
|
575
570
|
message: "@unmask 'mode' argument does not recognize value '%s'."
|
|
576
571
|
},
|
|
577
572
|
|
|
578
|
-
|
|
573
|
+
50: {
|
|
579
574
|
file: "@apollo/client/local-state/LocalState.js",
|
|
580
575
|
message: "Could not find a resolver for the '%s' field. The field value has been set to `null`."
|
|
581
576
|
},
|
|
582
577
|
|
|
583
|
-
|
|
578
|
+
51: {
|
|
584
579
|
file: "@apollo/client/local-state/LocalState.js",
|
|
585
580
|
message: "The '%s' resolver returned `undefined` instead of a value. This is likely a bug in the resolver. If you didn't mean to return a value, return `null` instead."
|
|
586
581
|
},
|
|
587
582
|
|
|
588
|
-
|
|
583
|
+
52: {
|
|
589
584
|
file: "@apollo/client/local-state/LocalState.js",
|
|
590
585
|
message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
|
|
591
586
|
},
|
|
592
587
|
|
|
593
|
-
|
|
588
|
+
53: {
|
|
594
589
|
file: "@apollo/client/local-state/LocalState.js",
|
|
595
590
|
message: "The '%s' field on object %o returned `undefined` instead of a value. The parent resolver did not include the property in the returned value and there was no resolver defined for the field."
|
|
596
591
|
},
|
|
597
592
|
|
|
598
|
-
|
|
593
|
+
61: {
|
|
599
594
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
600
595
|
message: "Multipart-subscriptions do not support @defer"
|
|
601
596
|
},
|
|
602
597
|
|
|
603
|
-
|
|
598
|
+
64: {
|
|
604
599
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
605
600
|
message: `You are calling concat on a terminating link, which will have no effect %o`
|
|
606
601
|
},
|
|
607
602
|
|
|
608
|
-
|
|
603
|
+
76: {
|
|
609
604
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
610
605
|
|
|
611
606
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
612
607
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
613
608
|
},
|
|
614
609
|
|
|
615
|
-
|
|
610
|
+
86: {
|
|
616
611
|
file: "@apollo/client/core/QueryManager.js",
|
|
617
612
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
618
613
|
},
|
|
619
614
|
|
|
620
|
-
|
|
615
|
+
87: {
|
|
621
616
|
file: "@apollo/client/core/QueryManager.js",
|
|
622
617
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
623
618
|
},
|
|
624
619
|
|
|
625
|
-
|
|
620
|
+
91: {
|
|
626
621
|
file: "@apollo/client/core/QueryManager.js",
|
|
627
622
|
message: '[%s]: Fragments masked by data masking are inaccessible when using fetch policy "no-cache". Please add `@unmask` to each fragment spread to access the data.'
|
|
628
623
|
},
|
|
629
624
|
|
|
630
|
-
|
|
625
|
+
95: {
|
|
631
626
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
632
627
|
|
|
633
628
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -635,24 +630,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
635
630
|
"`toReference(object, true)`"
|
|
636
631
|
},
|
|
637
632
|
|
|
638
|
-
|
|
633
|
+
96: {
|
|
639
634
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
640
635
|
|
|
641
636
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
642
637
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
643
638
|
},
|
|
644
639
|
|
|
645
|
-
|
|
640
|
+
99: {
|
|
646
641
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
647
642
|
message: `Inferring subtype %s of supertype %s`
|
|
648
643
|
},
|
|
649
644
|
|
|
650
|
-
|
|
645
|
+
100: {
|
|
651
646
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
652
647
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
653
648
|
},
|
|
654
649
|
|
|
655
|
-
|
|
650
|
+
107: {
|
|
656
651
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
657
652
|
|
|
658
653
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -671,7 +666,7 @@ For more information about these options, please refer to the documentation:
|
|
|
671
666
|
`
|
|
672
667
|
},
|
|
673
668
|
|
|
674
|
-
|
|
669
|
+
108: {
|
|
675
670
|
file: "@apollo/client/cache/core/cache.js",
|
|
676
671
|
message: "Could not identify object passed to `from` for '%s' fragment, either because the object is non-normalized or the key fields are missing. If you are masking this object, please ensure the key fields are requested by the parent object."
|
|
677
672
|
}
|
|
@@ -688,12 +683,12 @@ export const devError = {
|
|
|
688
683
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
689
684
|
},
|
|
690
685
|
|
|
691
|
-
|
|
686
|
+
78: {
|
|
692
687
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
693
688
|
message: "Unhandled GraphQL subscription error"
|
|
694
689
|
},
|
|
695
690
|
|
|
696
|
-
|
|
691
|
+
105: {
|
|
697
692
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
698
693
|
message: `Missing field '%s' while writing result %o`
|
|
699
694
|
}
|
package/link/core/ApolloLink.js
CHANGED
|
@@ -46,7 +46,7 @@ export class ApolloLink {
|
|
|
46
46
|
static concat(first, second) {
|
|
47
47
|
const firstLink = toLink(first);
|
|
48
48
|
if (isTerminating(firstLink)) {
|
|
49
|
-
__DEV__ && invariant.warn(
|
|
49
|
+
__DEV__ && invariant.warn(64, firstLink);
|
|
50
50
|
return firstLink;
|
|
51
51
|
}
|
|
52
52
|
const nextLink = toLink(second);
|
|
@@ -75,7 +75,7 @@ export class ApolloLink {
|
|
|
75
75
|
return ApolloLink.concat(this, next);
|
|
76
76
|
}
|
|
77
77
|
request(operation, forward) {
|
|
78
|
-
throw newInvariantError(
|
|
78
|
+
throw newInvariantError(65);
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* @internal
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { invariant } from "@apollo/client/utilities/invariant";
|
|
2
2
|
export const checkFetcher = (fetcher) => {
|
|
3
|
-
invariant(fetcher || typeof fetch !== "undefined",
|
|
3
|
+
invariant(fetcher || typeof fetch !== "undefined", 60);
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=checkFetcher.js.map
|
|
@@ -83,7 +83,7 @@ export const createHttpLink = (linkOptions = {}) => {
|
|
|
83
83
|
// Omit defer-specific headers if the user attempts to defer a selection
|
|
84
84
|
// set on a subscription and log a warning.
|
|
85
85
|
if (isSubscription && hasDefer) {
|
|
86
|
-
__DEV__ && invariant.warn(
|
|
86
|
+
__DEV__ && invariant.warn(61);
|
|
87
87
|
}
|
|
88
88
|
if (isSubscription) {
|
|
89
89
|
acceptHeader +=
|
|
@@ -30,7 +30,7 @@ export async function readMultipartBody(response, nextValue) {
|
|
|
30
30
|
: "-";
|
|
31
31
|
const boundary = `\r\n--${boundaryVal}`;
|
|
32
32
|
let buffer = "";
|
|
33
|
-
invariant(response.body && typeof response.body.getReader === "function",
|
|
33
|
+
invariant(response.body && typeof response.body.getReader === "function", 62);
|
|
34
34
|
const iterator = response.body.getReader();
|
|
35
35
|
let running = true;
|
|
36
36
|
while (running) {
|
|
@@ -5,7 +5,7 @@ export const serializeFetchParameter = (p, label) => {
|
|
|
5
5
|
serialized = JSON.stringify(p);
|
|
6
6
|
}
|
|
7
7
|
catch (e) {
|
|
8
|
-
const parseError = newInvariantError(
|
|
8
|
+
const parseError = newInvariantError(63, label, e.message);
|
|
9
9
|
parseError.parseError = e;
|
|
10
10
|
throw parseError;
|
|
11
11
|
}
|
|
@@ -43,7 +43,7 @@ export const createPersistedQueryLink = (options) => {
|
|
|
43
43
|
// hashing with something other than SHA-256.
|
|
44
44
|
invariant(options &&
|
|
45
45
|
(typeof options.sha256 === "function" ||
|
|
46
|
-
typeof options.generateHash === "function"),
|
|
46
|
+
typeof options.generateHash === "function"), 58);
|
|
47
47
|
const { sha256,
|
|
48
48
|
// If both a `sha256` and `generateHash` option are provided, the
|
|
49
49
|
// `sha256` option will be ignored. Developers can configure and
|
|
@@ -69,7 +69,7 @@ export const createPersistedQueryLink = (options) => {
|
|
|
69
69
|
return hash;
|
|
70
70
|
}
|
|
71
71
|
return Object.assign(new ApolloLink((operation, forward) => {
|
|
72
|
-
invariant(forward,
|
|
72
|
+
invariant(forward, 59);
|
|
73
73
|
const { query } = operation;
|
|
74
74
|
return new Observable((observer) => {
|
|
75
75
|
let subscription;
|