@apollo/client 4.3.3 → 4.3.4

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/__cjs/cache/core/cache.cjs +1 -1
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +4 -1
  5. package/__cjs/cache/core/types/Cache.d.cts +5 -0
  6. package/__cjs/cache/inmemory/entityStore.cjs +4 -4
  7. package/__cjs/cache/inmemory/inMemoryCache.cjs +15 -5
  8. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  9. package/__cjs/cache/inmemory/inMemoryCache.d.cts +3 -1
  10. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  11. package/__cjs/cache/inmemory/policies.cjs +5 -5
  12. package/__cjs/cache/inmemory/readFromStore.cjs +28 -10
  13. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  14. package/__cjs/cache/inmemory/types.d.cts +7 -2
  15. package/__cjs/cache/inmemory/writeToStore.cjs +29 -14
  16. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  17. package/__cjs/cache/inmemory/writeToStore.d.cts +5 -2
  18. package/__cjs/core/ApolloClient.cjs +14 -14
  19. package/__cjs/core/ObservableQuery.cjs +8 -8
  20. package/__cjs/core/QueryInfo.cjs +13 -32
  21. package/__cjs/core/QueryInfo.cjs.map +1 -1
  22. package/__cjs/core/QueryManager.cjs +12 -12
  23. package/__cjs/core/RefetchEventManager.cjs +3 -3
  24. package/__cjs/incremental/handlers/defer20220824.cjs +15 -2
  25. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
  26. package/__cjs/incremental/handlers/defer20220824.d.cts +5 -1
  27. package/__cjs/incremental/handlers/graphql17Alpha9.cjs +58 -14
  28. package/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +1 -1
  29. package/__cjs/incremental/handlers/graphql17Alpha9.d.cts +23 -12
  30. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  31. package/__cjs/incremental/types.d.cts +19 -1
  32. package/__cjs/invariantErrorCodes.cjs +64 -58
  33. package/__cjs/utilities/internal/index.cjs.map +1 -1
  34. package/__cjs/utilities/internal/index.d.cts +0 -1
  35. package/__cjs/version.cjs +1 -1
  36. package/cache/core/cache.d.ts +4 -1
  37. package/cache/core/cache.js +1 -1
  38. package/cache/core/cache.js.map +1 -1
  39. package/cache/core/types/Cache.d.ts +5 -0
  40. package/cache/core/types/Cache.js.map +1 -1
  41. package/cache/inmemory/entityStore.js +4 -4
  42. package/cache/inmemory/inMemoryCache.d.ts +3 -1
  43. package/cache/inmemory/inMemoryCache.js +15 -5
  44. package/cache/inmemory/inMemoryCache.js.map +1 -1
  45. package/cache/inmemory/key-extractor.js +1 -1
  46. package/cache/inmemory/policies.js +5 -5
  47. package/cache/inmemory/readFromStore.js +28 -10
  48. package/cache/inmemory/readFromStore.js.map +1 -1
  49. package/cache/inmemory/types.d.ts +7 -2
  50. package/cache/inmemory/types.js.map +1 -1
  51. package/cache/inmemory/writeToStore.d.ts +5 -2
  52. package/cache/inmemory/writeToStore.js +30 -15
  53. package/cache/inmemory/writeToStore.js.map +1 -1
  54. package/core/ApolloClient.js +14 -14
  55. package/core/ObservableQuery.js +8 -8
  56. package/core/QueryInfo.js +14 -33
  57. package/core/QueryInfo.js.map +1 -1
  58. package/core/QueryManager.js +12 -12
  59. package/core/RefetchEventManager.js +3 -3
  60. package/incremental/handlers/defer20220824.d.ts +5 -1
  61. package/incremental/handlers/defer20220824.js +15 -2
  62. package/incremental/handlers/defer20220824.js.map +1 -1
  63. package/incremental/handlers/graphql17Alpha9.d.ts +23 -12
  64. package/incremental/handlers/graphql17Alpha9.js +58 -14
  65. package/incremental/handlers/graphql17Alpha9.js.map +1 -1
  66. package/incremental/handlers/notImplemented.js +1 -1
  67. package/incremental/types.d.ts +19 -1
  68. package/incremental/types.js.map +1 -1
  69. package/invariantErrorCodes.js +64 -58
  70. package/package.json +1 -1
  71. package/utilities/internal/index.d.ts +0 -1
  72. package/utilities/internal/index.js.map +1 -1
  73. package/version.js +1 -1
  74. package/__cjs/utilities/internal/types/DeferInfo.cjs +0 -3
  75. package/__cjs/utilities/internal/types/DeferInfo.cjs.map +0 -1
  76. package/__cjs/utilities/internal/types/DeferInfo.d.cts +0 -10
  77. package/utilities/internal/types/DeferInfo.d.ts +0 -10
  78. package/utilities/internal/types/DeferInfo.js +0 -2
  79. package/utilities/internal/types/DeferInfo.js.map +0 -1
@@ -346,18 +346,24 @@ const client = new ApolloClient({
346
346
  },
347
347
 
348
348
  68: {
349
+ file: "@apollo/client/__cjs/incremental/handlers/graphql17Alpha9.cjs",
350
+ condition: "labelNode && labelNode.value.kind === \"StringValue\"",
351
+ message: "Expected a label for @defer directive"
352
+ },
353
+
354
+ 69: {
349
355
  file: "@apollo/client/__cjs/incremental/handlers/graphql17Alpha9.cjs",
350
356
  condition: "pending",
351
357
  message: "Could not find pending chunk for incremental value. Please file an issue for the Apollo Client team to investigate."
352
358
  },
353
359
 
354
- 69: {
360
+ 70: {
355
361
  file: "@apollo/client/__cjs/incremental/handlers/notImplemented.cjs",
356
362
  condition: "!(0, internal_1.hasDirectives)([\"defer\", \"stream\"], request.query)",
357
363
  message: "`@defer` and `@stream` are not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
358
364
  },
359
365
 
360
- 70: {
366
+ 71: {
361
367
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
362
368
  condition: "options.cache",
363
369
 
@@ -366,7 +372,7 @@ const client = new ApolloClient({
366
372
  "For more information, please visit: https://go.apollo.dev/c/docs"
367
373
  },
368
374
 
369
- 71: {
375
+ 72: {
370
376
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
371
377
  condition: "options.link",
372
378
 
@@ -375,7 +381,7 @@ const client = new ApolloClient({
375
381
  "For more information, please visit: https://go.apollo.dev/c/docs"
376
382
  },
377
383
 
378
- 74: {
384
+ 75: {
379
385
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
380
386
  condition: "options.fetchPolicy !== \"cache-and-network\"",
381
387
 
@@ -385,7 +391,7 @@ const client = new ApolloClient({
385
391
  "using a different fetchPolicy, such as cache-first or network-only."
386
392
  },
387
393
 
388
- 75: {
394
+ 76: {
389
395
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
390
396
  condition: "options.fetchPolicy !== \"standby\"",
391
397
 
@@ -394,7 +400,7 @@ const client = new ApolloClient({
394
400
  "as cache-first or network-only."
395
401
  },
396
402
 
397
- 76: {
403
+ 77: {
398
404
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
399
405
  condition: "options.query",
400
406
 
@@ -402,164 +408,164 @@ const client = new ApolloClient({
402
408
  "in the query option."
403
409
  },
404
410
 
405
- 77: {
411
+ 78: {
406
412
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
407
413
  condition: "options.query.kind === \"Document\"",
408
414
  message: 'You must wrap the query string in a "gql" tag.'
409
415
  },
410
416
 
411
- 78: {
417
+ 79: {
412
418
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
413
419
  condition: "!options.returnPartialData",
414
420
  message: "returnPartialData option only supported on watchQuery."
415
421
  },
416
422
 
417
- 79: {
423
+ 80: {
418
424
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
419
425
  condition: "!options.pollInterval",
420
426
  message: "pollInterval option only supported on watchQuery."
421
427
  },
422
428
 
423
- 80: {
429
+ 81: {
424
430
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
425
431
  condition: "!options.notifyOnNetworkStatusChange",
426
432
  message: "notifyOnNetworkStatusChange option only supported on watchQuery."
427
433
  },
428
434
 
429
- 81: {
435
+ 82: {
430
436
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
431
437
  condition: "optionsWithDefaults.mutation",
432
438
  message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
433
439
  },
434
440
 
435
- 82: {
441
+ 83: {
436
442
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
437
443
  condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
438
444
  message: "Mutations only support 'network-only' or 'no-cache' fetch policies. The default 'network-only' behavior automatically writes mutation results to the cache. Passing 'no-cache' skips the cache write."
439
445
  },
440
446
 
441
- 84: {
447
+ 85: {
442
448
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
443
449
  condition: "fetchPolicy === \"standby\"",
444
450
  message: "The `variablesUnknown` option can only be used together with a `standby` fetch policy."
445
451
  },
446
452
 
447
- 86: {
453
+ 87: {
448
454
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
449
455
  condition: "this.options.fetchPolicy !== \"cache-only\"",
450
456
  message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
451
457
  },
452
458
 
453
- 87: {
459
+ 88: {
454
460
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
455
461
  condition: "updateQuery",
456
462
  message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
457
463
  },
458
464
 
459
- 93: {
465
+ 94: {
460
466
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
461
467
  message: "QueryManager stopped while query was in flight"
462
468
  },
463
469
 
464
- 94: {
470
+ 95: {
465
471
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
466
472
  condition: "this.localState",
467
473
  message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
468
474
  },
469
475
 
470
- 95: {
476
+ 96: {
471
477
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
472
478
  message: "Store reset while query was in flight (not completed in link chain)"
473
479
  },
474
480
 
475
- 98: {
481
+ 99: {
476
482
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
477
483
  condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
478
484
  message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
479
485
  },
480
486
 
481
- 99: {
487
+ 100: {
482
488
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
483
489
  condition: "this.localState",
484
490
  message: "%s '%s' contains `@client` fields but local state has not been configured."
485
491
  },
486
492
 
487
- 100: {
493
+ 101: {
488
494
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
489
495
  condition: "!hasIncrementalDirective",
490
496
  message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
491
497
  },
492
498
 
493
- 101: {
499
+ 102: {
494
500
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
495
501
  condition: "this.localState",
496
502
  message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
497
503
  },
498
504
 
499
- 103: {
505
+ 104: {
500
506
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
501
507
  condition: "this.localState",
502
508
  message: "Query '%s' contains `@client` fields but local state has not been configured."
503
509
  },
504
510
 
505
- 104: {
511
+ 105: {
506
512
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
507
513
  condition: "didEmitValue",
508
514
  message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
509
515
  },
510
516
 
511
- 108: {
517
+ 109: {
512
518
  file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
513
519
  condition: "typeof dataId === \"string\"",
514
520
  message: "store.merge expects a string ID"
515
521
  },
516
522
 
517
- 113: {
523
+ 114: {
518
524
  file: "@apollo/client/__cjs/cache/inmemory/key-extractor.cjs",
519
525
  condition: "extracted !== void 0",
520
526
  message: `Missing field '%s' while extracting keyFields from %s`
521
527
  },
522
528
 
523
- 114: {
529
+ 115: {
524
530
  file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
525
531
  condition: "!old || old === which",
526
532
  message: `Cannot change root %s __typename more than once`
527
533
  },
528
534
 
529
- 117: {
535
+ 118: {
530
536
  file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
531
537
  message: "Cannot automatically merge arrays"
532
538
  },
533
539
 
534
- 120: {
540
+ 121: {
535
541
  file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
536
542
  message: `No fragment named %s`
537
543
  },
538
544
 
539
- 121: {
545
+ 122: {
540
546
  file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
541
547
  condition: "!(0, utilities_1.isReference)(value)",
542
548
  message: `Missing selection set for object of type %s returned for query field %s`
543
549
  },
544
550
 
545
- 122: {
551
+ 123: {
546
552
  file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
547
553
  message: `Could not identify object %s`
548
554
  },
549
555
 
550
- 124: {
556
+ 125: {
551
557
  file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
552
558
  message: `No fragment named %s`
553
559
  }
554
560
  };
555
561
 
556
562
  exports.devDebug = {
557
- 83: {
563
+ 84: {
558
564
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
559
565
  message: `In client.refetchQueries, Promise.all promise rejected with error %o`
560
566
  },
561
567
 
562
- 90: {
568
+ 91: {
563
569
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
564
570
  message: `Missing cache result fields: %o`
565
571
  }
@@ -642,29 +648,29 @@ exports.devWarn = {
642
648
  "If you are using a split link, ensure each branch contains a terminating link that handles the request."
643
649
  },
644
650
 
645
- 72: {
651
+ 73: {
646
652
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
647
653
  message: "`refetchOn` was set on query '%s' but no `RefetchEventManager` is configured on this `ApolloClient` instance. This option has no effect until a RefetchEventManager is connected to this client. Pass a `RefetchEventManager` instance to the `refetchEventManager` option on the `ApolloClient` constructor."
648
654
  },
649
655
 
650
- 73: {
656
+ 74: {
651
657
  file: "@apollo/client/__cjs/core/ApolloClient.cjs",
652
658
  message: "`refetchOn` references the '%s' event on query '%s' but no source is configured for it on the `RefetchEventManager`. This event will never fire. Add a source for the event to the `sources` option or call `setEventSource` on the refetch event manager."
653
659
  },
654
660
 
655
- 85: {
661
+ 86: {
656
662
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
657
663
 
658
664
  message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
659
665
  Did you mean to call refetch(variables) instead of refetch({ variables })?`
660
666
  },
661
667
 
662
- 89: {
668
+ 90: {
663
669
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
664
670
  message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
665
671
  },
666
672
 
667
- 91: {
673
+ 92: {
668
674
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
669
675
 
670
676
  message: `Apollo Client stopped refetching '%s' because the same incomplete cache result was already refetched. Automatic refetching was halted to prevent an endless cycle of network requests.
@@ -684,7 +690,7 @@ For more information about these options, please refer to the documentation:
684
690
  `
685
691
  },
686
692
 
687
- 92: {
693
+ 93: {
688
694
  file: "@apollo/client/__cjs/core/QueryInfo.cjs",
689
695
 
690
696
  message: `The network result for query %s was written to the cache, but reading it back returned a partial result.
@@ -703,37 +709,37 @@ For more information, please refer to the documentation:
703
709
  `
704
710
  },
705
711
 
706
- 96: {
712
+ 97: {
707
713
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
708
714
  message: `Unknown query named "%s" requested in refetchQueries options.include array`
709
715
  },
710
716
 
711
- 97: {
717
+ 98: {
712
718
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
713
719
  message: `Unknown anonymous query requested in refetchQueries options.include array`
714
720
  },
715
721
 
716
- 102: {
722
+ 103: {
717
723
  file: "@apollo/client/__cjs/core/QueryManager.cjs",
718
724
  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.'
719
725
  },
720
726
 
721
- 105: {
727
+ 106: {
722
728
  file: "@apollo/client/__cjs/core/RefetchEventManager.cjs",
723
729
  message: "Connected an `ApolloClient` instance to a `RefetchEventManager` that was already connected to a different `ApolloClient`. The previous client has been disconnected and will no longer receive refetch events from this manager."
724
730
  },
725
731
 
726
- 106: {
732
+ 107: {
727
733
  file: "@apollo/client/__cjs/core/RefetchEventManager.cjs",
728
734
  message: "Received '%s' event but an `ApolloClient` instance is not connected to the `RefetchEventManager`. No queries will refetch. Pass the manager to the `refetchEventManager` option on the `ApolloClient` constructor."
729
735
  },
730
736
 
731
- 107: {
737
+ 108: {
732
738
  file: "@apollo/client/__cjs/core/RefetchEventManager.cjs",
733
739
  message: "Received '%s' event but no source is configured for it on the `RefetchEventManager`. No queries will refetch. Add the event to the `sources` option or call `setEventSource`."
734
740
  },
735
741
 
736
- 109: {
742
+ 110: {
737
743
  file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
738
744
 
739
745
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
@@ -741,44 +747,44 @@ For more information, please refer to the documentation:
741
747
  "`toReference(object, true)`"
742
748
  },
743
749
 
744
- 110: {
750
+ 111: {
745
751
  file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
746
752
 
747
753
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
748
754
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
749
755
  },
750
756
 
751
- 111: {
757
+ 112: {
752
758
  file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
753
759
  message: "The custom scalar configuration for '%s' uses list type '%s', but the value is not an array. The value was coerced as '%s' anyway."
754
760
  },
755
761
 
756
- 112: {
762
+ 113: {
757
763
  file: "@apollo/client/__cjs/cache/inmemory/inMemoryCache.cjs",
758
764
  message: "The variable '%s' has list type '%s', but the value is not an array. The value was coerced as '%s' anyway."
759
765
  },
760
766
 
761
- 115: {
767
+ 116: {
762
768
  file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
763
769
  message: `Inferring subtype %s of supertype %s`
764
770
  },
765
771
 
766
- 116: {
772
+ 117: {
767
773
  file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
768
774
  message: `Undefined 'from' passed to readField with arguments %s`
769
775
  },
770
776
 
771
- 118: {
777
+ 119: {
772
778
  file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
773
779
  message: "The field policy for '%s' is configured with the '%s' scalar, so its '%s' function is ignored. Scalar configuration cannot be used with custom read or merge functions."
774
780
  },
775
781
 
776
- 119: {
782
+ 120: {
777
783
  file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
778
784
  message: "The field policy for '%s' is configured with the '%s' scalar, but the field is not a scalar field because it contains a selection set. The field value remains unchanged."
779
785
  },
780
786
 
781
- 125: {
787
+ 126: {
782
788
  file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
783
789
 
784
790
  message: `Cache data may be lost when replacing the %s field of a %s object.
@@ -797,7 +803,7 @@ For more information about these options, please refer to the documentation:
797
803
  `
798
804
  },
799
805
 
800
- 126: {
806
+ 127: {
801
807
  file: "@apollo/client/__cjs/cache/core/cache.cjs",
802
808
  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."
803
809
  }
@@ -814,12 +820,12 @@ exports.devError = {
814
820
  message: "The result of getSnapshot should be cached to avoid an infinite loop"
815
821
  },
816
822
 
817
- 88: {
823
+ 89: {
818
824
  file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
819
825
  message: "Unhandled GraphQL subscription error"
820
826
  },
821
827
 
822
- 123: {
828
+ 124: {
823
829
  file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
824
830
  message: `Missing field '%s' while writing result %o`
825
831
  }