@apollo/client 4.0.9 → 4.0.13

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 (134) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/__cjs/cache/core/cache.cjs +49 -6
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +47 -0
  5. package/__cjs/cache/core/types/Cache.d.cts +28 -0
  6. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  7. package/__cjs/cache/inmemory/fragmentRegistry.cjs +5 -0
  8. package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
  9. package/__cjs/cache/inmemory/inMemoryCache.cjs +47 -0
  10. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  11. package/__cjs/cache/inmemory/inMemoryCache.d.cts +47 -0
  12. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  13. package/__cjs/cache/inmemory/policies.cjs +4 -4
  14. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  15. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  16. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  17. package/__cjs/core/ApolloClient.cjs.map +1 -1
  18. package/__cjs/core/ApolloClient.d.cts +16 -1
  19. package/__cjs/core/ObservableQuery.cjs +18 -7
  20. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  21. package/__cjs/core/ObservableQuery.d.cts +1 -0
  22. package/__cjs/core/QueryManager.cjs +13 -13
  23. package/__cjs/core/QueryManager.cjs.map +1 -1
  24. package/__cjs/invariantErrorCodes.cjs +39 -33
  25. package/__cjs/link/error/index.cjs +1 -1
  26. package/__cjs/link/error/index.cjs.map +1 -1
  27. package/__cjs/link/error/index.d.cts +1 -1
  28. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  29. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  30. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +51 -50
  31. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  32. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +3 -0
  33. package/__cjs/link/schema/index.cjs +1 -1
  34. package/__cjs/link/schema/index.cjs.map +1 -1
  35. package/__cjs/link/schema/index.d.cts +1 -1
  36. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  37. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  38. package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
  39. package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
  40. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  41. package/__cjs/react/hooks/useQuery.cjs +7 -4
  42. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  43. package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -0
  44. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  45. package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
  46. package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
  47. package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
  48. package/__cjs/utilities/internal/checkDocument.cjs +2 -4
  49. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  50. package/__cjs/utilities/internal/compact.cjs +1 -1
  51. package/__cjs/utilities/internal/compact.cjs.map +1 -1
  52. package/__cjs/utilities/internal/constants.cjs +13 -0
  53. package/__cjs/utilities/internal/constants.cjs.map +1 -0
  54. package/__cjs/utilities/internal/constants.d.cts +10 -0
  55. package/__cjs/utilities/internal/index.cjs +6 -2
  56. package/__cjs/utilities/internal/index.cjs.map +1 -1
  57. package/__cjs/utilities/internal/index.d.cts +2 -0
  58. package/__cjs/utilities/internal/memoize.cjs +31 -0
  59. package/__cjs/utilities/internal/memoize.cjs.map +1 -0
  60. package/__cjs/utilities/internal/memoize.d.cts +7 -0
  61. package/__cjs/version.cjs +1 -1
  62. package/__cjs/version.cjs.map +1 -1
  63. package/cache/core/cache.d.ts +47 -0
  64. package/cache/core/cache.js +50 -7
  65. package/cache/core/cache.js.map +1 -1
  66. package/cache/core/types/Cache.d.ts +28 -0
  67. package/cache/core/types/Cache.js.map +1 -1
  68. package/cache/inmemory/entityStore.js +3 -3
  69. package/cache/inmemory/fragmentRegistry.js +6 -1
  70. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  71. package/cache/inmemory/inMemoryCache.d.ts +47 -0
  72. package/cache/inmemory/inMemoryCache.js +47 -0
  73. package/cache/inmemory/inMemoryCache.js.map +1 -1
  74. package/cache/inmemory/key-extractor.js +1 -1
  75. package/cache/inmemory/policies.js +4 -4
  76. package/cache/inmemory/policies.js.map +1 -1
  77. package/cache/inmemory/readFromStore.js +2 -2
  78. package/cache/inmemory/writeToStore.js +4 -4
  79. package/core/ApolloClient.d.ts +16 -1
  80. package/core/ApolloClient.js.map +1 -1
  81. package/core/ObservableQuery.d.ts +1 -0
  82. package/core/ObservableQuery.js +19 -8
  83. package/core/ObservableQuery.js.map +1 -1
  84. package/core/QueryManager.js +13 -13
  85. package/core/QueryManager.js.map +1 -1
  86. package/invariantErrorCodes.js +39 -33
  87. package/link/error/index.d.ts +1 -1
  88. package/link/error/index.js +1 -1
  89. package/link/error/index.js.map +1 -1
  90. package/link/http/parseAndCheckHttpResponse.js +1 -1
  91. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  92. package/link/remove-typename/removeTypenameFromVariables.d.ts +3 -0
  93. package/link/remove-typename/removeTypenameFromVariables.js +51 -50
  94. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  95. package/link/schema/index.d.ts +1 -1
  96. package/link/schema/index.js +1 -1
  97. package/link/schema/index.js.map +1 -1
  98. package/package.json +1 -1
  99. package/react/hooks/useApolloClient.d.ts +1 -1
  100. package/react/hooks/useApolloClient.js +1 -1
  101. package/react/hooks/useApolloClient.js.map +1 -1
  102. package/react/hooks/useLazyQuery.js +2 -1
  103. package/react/hooks/useLazyQuery.js.map +1 -1
  104. package/react/hooks/useQuery.js +8 -5
  105. package/react/hooks/useQuery.js.map +1 -1
  106. package/react/hooks/useSuspenseQuery.js +2 -0
  107. package/react/hooks/useSuspenseQuery.js.map +1 -1
  108. package/react/hooks-compiled/useApolloClient.d.ts +1 -1
  109. package/react/hooks-compiled/useApolloClient.js +1 -1
  110. package/react/hooks-compiled/useApolloClient.js.map +1 -1
  111. package/react/hooks-compiled/useLazyQuery.js +2 -1
  112. package/react/hooks-compiled/useLazyQuery.js.map +1 -1
  113. package/react/hooks-compiled/useQuery.js +9 -5
  114. package/react/hooks-compiled/useQuery.js.map +1 -1
  115. package/react/hooks-compiled/useSuspenseQuery.js +3 -1
  116. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  117. package/utilities/internal/bindCacheKey.d.ts +15 -0
  118. package/utilities/internal/bindCacheKey.js +18 -0
  119. package/utilities/internal/bindCacheKey.js.map +1 -0
  120. package/utilities/internal/checkDocument.js +2 -4
  121. package/utilities/internal/checkDocument.js.map +1 -1
  122. package/utilities/internal/compact.js +1 -1
  123. package/utilities/internal/compact.js.map +1 -1
  124. package/utilities/internal/constants.d.ts +10 -0
  125. package/utilities/internal/constants.js +10 -0
  126. package/utilities/internal/constants.js.map +1 -0
  127. package/utilities/internal/index.d.ts +2 -0
  128. package/utilities/internal/index.js +2 -0
  129. package/utilities/internal/index.js.map +1 -1
  130. package/utilities/internal/memoize.d.ts +7 -0
  131. package/utilities/internal/memoize.js +28 -0
  132. package/utilities/internal/memoize.js.map +1 -0
  133. package/version.js +1 -1
  134. package/version.js.map +1 -1
@@ -212,7 +212,7 @@ class Policies {
212
212
  const rootId = "ROOT_" + which.toUpperCase();
213
213
  const old = this.rootTypenamesById[rootId];
214
214
  if (typename !== old) {
215
- (0, invariant_1.invariant)(!old || old === which, 99, which);
215
+ (0, invariant_1.invariant)(!old || old === which, 100, which);
216
216
  // First, delete any old __typename associated with this rootId from
217
217
  // rootIdsByTypename.
218
218
  if (old)
@@ -355,7 +355,7 @@ class Policies {
355
355
  if (supertypeSet.has(supertype)) {
356
356
  if (!typenameSupertypeSet.has(supertype)) {
357
357
  if (checkingFuzzySubtypes) {
358
- __DEV__ && invariant_1.invariant.warn(100, typename, supertype);
358
+ __DEV__ && invariant_1.invariant.warn(101, typename, supertype);
359
359
  }
360
360
  // Record positive results for faster future lookup.
361
361
  // Unfortunately, we cannot safely cache negative results,
@@ -566,7 +566,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
566
566
  }
567
567
  }
568
568
  if (environment_1.__DEV__ && options.from === void 0) {
569
- __DEV__ && invariant_1.invariant.warn(101, (0, internal_1.stringifyForDisplay)(Array.from(readFieldArgs)));
569
+ __DEV__ && invariant_1.invariant.warn(102, (0, internal_1.stringifyForDisplay)(Array.from(readFieldArgs)));
570
570
  }
571
571
  if (void 0 === options.variables) {
572
572
  options.variables = variables;
@@ -576,7 +576,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
576
576
  function makeMergeObjectsFunction(store) {
577
577
  return function mergeObjects(existing, incoming) {
578
578
  if ((0, internal_1.isArray)(existing) || (0, internal_1.isArray)(incoming)) {
579
- throw (0, invariant_1.newInvariantError)(102);
579
+ throw (0, invariant_1.newInvariantError)(103);
580
580
  }
581
581
  // These dynamic checks are necessary because the parameters of a
582
582
  // custom merge function can easily have the any type, so the type