@apollo/client 4.3.0-alpha.5 → 4.3.0-alpha.7

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 (52) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/__cjs/cache/core/cache.cjs +1 -1
  3. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  4. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  5. package/__cjs/cache/inmemory/policies.cjs +28 -6
  6. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  7. package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
  8. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  9. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  10. package/__cjs/core/ObservableQuery.cjs +175 -62
  11. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  12. package/__cjs/core/ObservableQuery.d.cts +4 -7
  13. package/__cjs/core/QueryInfo.cjs +13 -136
  14. package/__cjs/core/QueryInfo.cjs.map +1 -1
  15. package/__cjs/core/QueryInfo.d.cts +2 -26
  16. package/__cjs/core/QueryManager.cjs +26 -25
  17. package/__cjs/core/QueryManager.cjs.map +1 -1
  18. package/__cjs/core/RefetchEventManager.cjs +3 -3
  19. package/__cjs/invariantErrorCodes.cjs +57 -32
  20. package/__cjs/utilities/internal/index.cjs +3 -1
  21. package/__cjs/utilities/internal/index.cjs.map +1 -1
  22. package/__cjs/utilities/internal/index.d.cts +1 -0
  23. package/__cjs/utilities/internal/toDiffWithDataState.cjs +20 -0
  24. package/__cjs/utilities/internal/toDiffWithDataState.cjs.map +1 -0
  25. package/__cjs/utilities/internal/toDiffWithDataState.d.cts +8 -0
  26. package/__cjs/version.cjs +1 -1
  27. package/cache/core/cache.js +1 -1
  28. package/cache/inmemory/entityStore.js +3 -3
  29. package/cache/inmemory/key-extractor.js +1 -1
  30. package/cache/inmemory/policies.js +28 -6
  31. package/cache/inmemory/policies.js.map +1 -1
  32. package/cache/inmemory/readFromStore.js +3 -3
  33. package/cache/inmemory/readFromStore.js.map +1 -1
  34. package/cache/inmemory/writeToStore.js +4 -4
  35. package/core/ObservableQuery.d.ts +4 -7
  36. package/core/ObservableQuery.js +172 -63
  37. package/core/ObservableQuery.js.map +1 -1
  38. package/core/QueryInfo.d.ts +3 -27
  39. package/core/QueryInfo.js +14 -137
  40. package/core/QueryInfo.js.map +1 -1
  41. package/core/QueryManager.js +26 -25
  42. package/core/QueryManager.js.map +1 -1
  43. package/core/RefetchEventManager.js +3 -3
  44. package/invariantErrorCodes.js +57 -32
  45. package/package.json +1 -1
  46. package/utilities/internal/index.d.ts +1 -0
  47. package/utilities/internal/index.js +1 -0
  48. package/utilities/internal/index.js.map +1 -1
  49. package/utilities/internal/toDiffWithDataState.d.ts +8 -0
  50. package/utilities/internal/toDiffWithDataState.js +17 -0
  51. package/utilities/internal/toDiffWithDataState.js.map +1 -0
  52. package/version.js +1 -1
@@ -27,7 +27,7 @@ export class RefetchEventManager {
27
27
  }
28
28
  if (this.client) {
29
29
  if (__DEV__) {
30
- __DEV__ && invariant.warn(102);
30
+ __DEV__ && invariant.warn(103);
31
31
  }
32
32
  this.disconnect();
33
33
  }
@@ -96,13 +96,13 @@ export class RefetchEventManager {
96
96
  const [payload] = args;
97
97
  if (!this.client) {
98
98
  if (__DEV__) {
99
- __DEV__ && invariant.warn(103, source);
99
+ __DEV__ && invariant.warn(104, source);
100
100
  }
101
101
  return;
102
102
  }
103
103
  if (!this.hasSource(source)) {
104
104
  if (__DEV__) {
105
- __DEV__ && invariant.warn(104, source);
105
+ __DEV__ && invariant.warn(105, source);
106
106
  }
107
107
  return;
108
108
  }
@@ -444,98 +444,98 @@ const client = new ApolloClient({
444
444
  message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
445
445
  },
446
446
 
447
- 90: {
447
+ 91: {
448
448
  file: "@apollo/client/core/QueryManager.js",
449
449
  message: "QueryManager stopped while query was in flight"
450
450
  },
451
451
 
452
- 91: {
452
+ 92: {
453
453
  file: "@apollo/client/core/QueryManager.js",
454
454
  condition: "this.localState",
455
455
  message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
456
456
  },
457
457
 
458
- 92: {
458
+ 93: {
459
459
  file: "@apollo/client/core/QueryManager.js",
460
460
  message: "Store reset while query was in flight (not completed in link chain)"
461
461
  },
462
462
 
463
- 95: {
463
+ 96: {
464
464
  file: "@apollo/client/core/QueryManager.js",
465
465
  condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
466
466
  message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
467
467
  },
468
468
 
469
- 96: {
469
+ 97: {
470
470
  file: "@apollo/client/core/QueryManager.js",
471
471
  condition: "this.localState",
472
472
  message: "%s '%s' contains `@client` fields but local state has not been configured."
473
473
  },
474
474
 
475
- 97: {
475
+ 98: {
476
476
  file: "@apollo/client/core/QueryManager.js",
477
477
  condition: "!hasIncrementalDirective",
478
478
  message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
479
479
  },
480
480
 
481
- 98: {
481
+ 99: {
482
482
  file: "@apollo/client/core/QueryManager.js",
483
483
  condition: "this.localState",
484
484
  message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
485
485
  },
486
486
 
487
- 100: {
487
+ 101: {
488
488
  file: "@apollo/client/core/QueryManager.js",
489
489
  condition: "this.localState",
490
490
  message: "Query '%s' contains `@client` fields but local state has not been configured."
491
491
  },
492
492
 
493
- 101: {
493
+ 102: {
494
494
  file: "@apollo/client/core/QueryManager.js",
495
495
  condition: "didEmitValue",
496
496
  message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
497
497
  },
498
498
 
499
- 105: {
499
+ 106: {
500
500
  file: "@apollo/client/cache/inmemory/entityStore.js",
501
501
  condition: "typeof dataId === \"string\"",
502
502
  message: "store.merge expects a string ID"
503
503
  },
504
504
 
505
- 108: {
505
+ 109: {
506
506
  file: "@apollo/client/cache/inmemory/key-extractor.js",
507
507
  condition: "extracted !== void 0",
508
508
  message: `Missing field '%s' while extracting keyFields from %s`
509
509
  },
510
510
 
511
- 109: {
511
+ 110: {
512
512
  file: "@apollo/client/cache/inmemory/policies.js",
513
513
  condition: "!old || old === which",
514
514
  message: `Cannot change root %s __typename more than once`
515
515
  },
516
516
 
517
- 112: {
517
+ 113: {
518
518
  file: "@apollo/client/cache/inmemory/policies.js",
519
519
  message: "Cannot automatically merge arrays"
520
520
  },
521
521
 
522
- 114: {
522
+ 116: {
523
523
  file: "@apollo/client/cache/inmemory/readFromStore.js",
524
524
  message: `No fragment named %s`
525
525
  },
526
526
 
527
- 115: {
527
+ 117: {
528
528
  file: "@apollo/client/cache/inmemory/readFromStore.js",
529
529
  condition: "!isReference(value)",
530
530
  message: `Missing selection set for object of type %s returned for query field %s`
531
531
  },
532
532
 
533
- 116: {
533
+ 118: {
534
534
  file: "@apollo/client/cache/inmemory/writeToStore.js",
535
535
  message: `Could not identify object %s`
536
536
  },
537
537
 
538
- 118: {
538
+ 120: {
539
539
  file: "@apollo/client/cache/inmemory/writeToStore.js",
540
540
  message: `No fragment named %s`
541
541
  }
@@ -648,6 +648,26 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
648
648
  },
649
649
 
650
650
  89: {
651
+ file: "@apollo/client/core/ObservableQuery.js",
652
+
653
+ 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.
654
+
655
+ This often means another query is overwriting non-normalized data selected by this query. Common fixes:
656
+
657
+ * Select an \`id\` or \`_id\` field in each query that writes the object
658
+ * Set custom \`keyFields\` if the object uses a different identity
659
+ * Add a field \`merge\` function so partial writes combine instead of replace
660
+
661
+ missing fields: %o
662
+
663
+ For more information about these options, please refer to the documentation:
664
+
665
+ * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
666
+ * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
667
+ `
668
+ },
669
+
670
+ 90: {
651
671
  file: "@apollo/client/core/QueryInfo.js",
652
672
 
653
673
  message: `The network result for query %s was written to the cache, but reading it back returned a partial result.
@@ -666,37 +686,37 @@ For more information, please refer to the documentation:
666
686
  `
667
687
  },
668
688
 
669
- 93: {
689
+ 94: {
670
690
  file: "@apollo/client/core/QueryManager.js",
671
691
  message: `Unknown query named "%s" requested in refetchQueries options.include array`
672
692
  },
673
693
 
674
- 94: {
694
+ 95: {
675
695
  file: "@apollo/client/core/QueryManager.js",
676
696
  message: `Unknown anonymous query requested in refetchQueries options.include array`
677
697
  },
678
698
 
679
- 99: {
699
+ 100: {
680
700
  file: "@apollo/client/core/QueryManager.js",
681
701
  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.'
682
702
  },
683
703
 
684
- 102: {
704
+ 103: {
685
705
  file: "@apollo/client/core/RefetchEventManager.js",
686
706
  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."
687
707
  },
688
708
 
689
- 103: {
709
+ 104: {
690
710
  file: "@apollo/client/core/RefetchEventManager.js",
691
711
  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."
692
712
  },
693
713
 
694
- 104: {
714
+ 105: {
695
715
  file: "@apollo/client/core/RefetchEventManager.js",
696
716
  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`."
697
717
  },
698
718
 
699
- 106: {
719
+ 107: {
700
720
  file: "@apollo/client/cache/inmemory/entityStore.js",
701
721
 
702
722
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
@@ -704,29 +724,34 @@ For more information, please refer to the documentation:
704
724
  "`toReference(object, true)`"
705
725
  },
706
726
 
707
- 107: {
727
+ 108: {
708
728
  file: "@apollo/client/cache/inmemory/entityStore.js",
709
729
 
710
730
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
711
731
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
712
732
  },
713
733
 
714
- 110: {
734
+ 111: {
715
735
  file: "@apollo/client/cache/inmemory/policies.js",
716
736
  message: `Inferring subtype %s of supertype %s`
717
737
  },
718
738
 
719
- 111: {
739
+ 112: {
720
740
  file: "@apollo/client/cache/inmemory/policies.js",
721
741
  message: `Undefined 'from' passed to readField with arguments %s`
722
742
  },
723
743
 
724
- 113: {
744
+ 114: {
745
+ file: "@apollo/client/cache/inmemory/policies.js",
746
+ 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."
747
+ },
748
+
749
+ 115: {
725
750
  file: "@apollo/client/cache/inmemory/readFromStore.js",
726
- message: "The field policy for '%s' is configured as a '%s' scalar, but the field is not a scalar field because it contains a selection set. The field value remains unchanged."
751
+ 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."
727
752
  },
728
753
 
729
- 119: {
754
+ 121: {
730
755
  file: "@apollo/client/cache/inmemory/writeToStore.js",
731
756
 
732
757
  message: `Cache data may be lost when replacing the %s field of a %s object.
@@ -745,7 +770,7 @@ For more information about these options, please refer to the documentation:
745
770
  `
746
771
  },
747
772
 
748
- 120: {
773
+ 122: {
749
774
  file: "@apollo/client/cache/core/cache.js",
750
775
  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."
751
776
  }
@@ -767,7 +792,7 @@ export const devError = {
767
792
  message: "Unhandled GraphQL subscription error"
768
793
  },
769
794
 
770
- 117: {
795
+ 119: {
771
796
  file: "@apollo/client/cache/inmemory/writeToStore.js",
772
797
  message: `Missing field '%s' while writing result %o`
773
798
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "4.3.0-alpha.5",
3
+ "version": "4.3.0-alpha.7",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -73,6 +73,7 @@ export { shouldInclude } from "./shouldInclude.js";
73
73
  export { storeKeyNameFromField } from "./storeKeyNameFromField.js";
74
74
  export { StreamArrayState } from "./StreamArrayState.js";
75
75
  export { stringifyForDisplay } from "./stringifyForDisplay.js";
76
+ export { toDiffWithDataState } from "./toDiffWithDataState.js";
76
77
  export { toQueryResult } from "./toQueryResult.js";
77
78
  export { filterMap } from "./filterMap.js";
78
79
  export { equalByQuery } from "./equalByQuery.js";
@@ -52,6 +52,7 @@ export { shouldInclude } from "./shouldInclude.js";
52
52
  export { storeKeyNameFromField } from "./storeKeyNameFromField.js";
53
53
  export { StreamArrayState } from "./StreamArrayState.js";
54
54
  export { stringifyForDisplay } from "./stringifyForDisplay.js";
55
+ export { toDiffWithDataState } from "./toDiffWithDataState.js";
55
56
  export { toQueryResult } from "./toQueryResult.js";
56
57
  export { filterMap } from "./filterMap.js";
57
58
  export { equalByQuery } from "./equalByQuery.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D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MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { ExtensionsWithStreamInfo } from \"./types/ExtensionsWithStreamDetails.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { IsLooselyEqual } from \"./types/IsLooselyEqual.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { StreamInfoTrie } from \"./types/StreamInfoTrie.js\";\nexport type { DeferInfoTrie } from \"./types/DeferInfo.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\nexport type { LazyType } from \"./LazyType.js\";\nexport type {\n ClassicSignature,\n SignatureStyle,\n} from \"./types/SignatureStyle.js\";\nexport type { OptionWithFallback } from \"./types/OptionWithFallback.js\";\n\nexport { addDeferFragmentLabels } from \"./addDeferFragmentLabels.js\";\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { combineLatestBatched } from \"./combineLatestBatched.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getDirectiveArgValue } from \"./getDirectiveArgValue.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { getUnwrappedType } from \"./getUnwrappedType.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDeferredFragment } from \"./isDeferredFragment.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { isStreamField } from \"./isStreamField.js\";\nexport { isTypenameField } from \"./isTypenameField.js\";\nexport { makeStreamInfoTrie } from \"./makeStreamInfoTrie.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { StreamArrayState } from \"./StreamArrayState.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\nexport { equalByQuery } from \"./equalByQuery.js\";\nexport { canonicalStringify } from \"./canonicalStringify.js\";\nexport { mapObservableFragmentMemoized } from \"./mapObservableFragment.js\";\nexport {\n extensionsSymbol,\n handleIncrementalSymbol,\n streamInfoSymbol,\n variablesUnknownSymbol,\n} from \"./constants.js\";\nexport { bindCacheKey } from \"./bindCacheKey.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AA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AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { ExtensionsWithStreamInfo } from \"./types/ExtensionsWithStreamDetails.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { IsLooselyEqual } from \"./types/IsLooselyEqual.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { StreamInfoTrie } from \"./types/StreamInfoTrie.js\";\nexport type { DeferInfoTrie } from \"./types/DeferInfo.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\nexport type { LazyType } from \"./LazyType.js\";\nexport type {\n ClassicSignature,\n SignatureStyle,\n} from \"./types/SignatureStyle.js\";\nexport type { OptionWithFallback } from \"./types/OptionWithFallback.js\";\n\nexport { addDeferFragmentLabels } from \"./addDeferFragmentLabels.js\";\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { combineLatestBatched } from \"./combineLatestBatched.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getDirectiveArgValue } from \"./getDirectiveArgValue.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { getUnwrappedType } from \"./getUnwrappedType.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDeferredFragment } from \"./isDeferredFragment.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { isStreamField } from \"./isStreamField.js\";\nexport { isTypenameField } from \"./isTypenameField.js\";\nexport { makeStreamInfoTrie } from \"./makeStreamInfoTrie.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { StreamArrayState } from \"./StreamArrayState.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toDiffWithDataState } from \"./toDiffWithDataState.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\nexport { equalByQuery } from \"./equalByQuery.js\";\nexport { canonicalStringify } from \"./canonicalStringify.js\";\nexport { mapObservableFragmentMemoized } from \"./mapObservableFragment.js\";\nexport {\n extensionsSymbol,\n handleIncrementalSymbol,\n streamInfoSymbol,\n variablesUnknownSymbol,\n} from \"./constants.js\";\nexport { bindCacheKey } from \"./bindCacheKey.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
@@ -0,0 +1,8 @@
1
+ import type { Cache } from "@apollo/client/cache";
2
+ /**
3
+ * @internal
4
+ *
5
+ * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
6
+ */
7
+ export declare function toDiffWithDataState<TData>(diff: Cache.DiffResult<TData> | Cache.InternalDiffResultWithDataState<TData>): Cache.InternalDiffResultWithDataState<TData>;
8
+ //# sourceMappingURL=toDiffWithDataState.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
5
+ */
6
+ export function toDiffWithDataState(diff) {
7
+ if ("dataState" in diff) {
8
+ return diff;
9
+ }
10
+ return {
11
+ ...diff,
12
+ dataState: diff.complete ? "complete"
13
+ : diff.result === null ? "empty"
14
+ : "partial",
15
+ };
16
+ }
17
+ //# sourceMappingURL=toDiffWithDataState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toDiffWithDataState.js","sources":["../../../src/utilities/internal/toDiffWithDataState.ts"],"sourcesContent":["import type { Cache } from \"@apollo/client/cache\";\n\n/** @internal */\nexport function toDiffWithDataState<TData>(\n diff: Cache.DiffResult<TData> | Cache.InternalDiffResultWithDataState<TData>\n): Cache.InternalDiffResultWithDataState<TData> {\n if (\"dataState\" in diff) {\n return diff;\n }\n\n return {\n ...diff,\n dataState:\n diff.complete ? \"complete\"\n : diff.result === null ? \"empty\"\n : \"partial\",\n } as Cache.InternalDiffResultWithDataState<TData>;\n}\n"],"names":[],"mappings":";;;;;AAGA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmC,CACjC,CADF,CAAA,CAAA,CAC8E,EAD9E;IAGE,CAAF,EAAA,CAAM,CAAN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAqB,CAArB,CAAA,CAAA,CAAyB,EAAE;QACvB,CAAJ,CAAA,CAAA,CAAA,CAAA,EAAW,CAAX,CAAA,CAAA,CAAe;IACb;IAEA,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS;QACL,CAAJ,CAAA,CAAO,CAAP,CAAA,CAAA,CAAW;QACP,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,EACP,CADN,CAAA,CAAA,CACU,CAAC,CADX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACoB,EAAE,CADtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;YAEM,EAAE,CAAR,CAAA,CAAA,CAAY,CAAC,CAAb,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAwB,CAAxB,CAAA,CAAA,EAA6B,EAAE,CAA/B,CAAA,CAAA,CAAA,CAAA,CAAA;gBACM,EAAE,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB;IACjB,CAAmD;AACnD;"}
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const version = "4.3.0-alpha.5";
1
+ export const version = "4.3.0-alpha.7";
2
2
  export const build = "esm";
3
3
  //# sourceMappingURL=version.js.map