@apollo/client 4.3.0-alpha.6 → 4.3.0-alpha.8

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 (140) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/__cjs/cache/core/cache.cjs +25 -1
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +19 -1
  5. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  6. package/__cjs/cache/inmemory/inMemoryCache.cjs +10 -0
  7. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  8. package/__cjs/cache/inmemory/inMemoryCache.d.cts +5 -1
  9. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  10. package/__cjs/cache/inmemory/policies.cjs +5 -5
  11. package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
  12. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  13. package/__cjs/core/ApolloClient.cjs +14 -14
  14. package/__cjs/core/ObservableQuery.cjs +173 -61
  15. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  16. package/__cjs/core/ObservableQuery.d.cts +3 -6
  17. package/__cjs/core/QueryInfo.cjs +11 -125
  18. package/__cjs/core/QueryInfo.cjs.map +1 -1
  19. package/__cjs/core/QueryInfo.d.cts +0 -24
  20. package/__cjs/core/QueryManager.cjs +23 -15
  21. package/__cjs/core/QueryManager.cjs.map +1 -1
  22. package/__cjs/core/RefetchEventManager.cjs +3 -3
  23. package/__cjs/incremental/handlers/graphql17Alpha9.cjs +1 -1
  24. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  25. package/__cjs/invariantErrorCodes.cjs +141 -115
  26. package/__cjs/link/core/ApolloLink.cjs +3 -3
  27. package/__cjs/link/http/checkFetcher.cjs +1 -1
  28. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +2 -2
  29. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  30. package/__cjs/link/persisted-queries/index.cjs +2 -2
  31. package/__cjs/link/ws/index.cjs +1 -1
  32. package/__cjs/local-state/LocalState.cjs +11 -11
  33. package/__cjs/masking/maskDefinition.cjs +2 -2
  34. package/__cjs/masking/maskFragment.cjs +2 -2
  35. package/__cjs/masking/maskOperation.cjs +1 -1
  36. package/__cjs/masking/utils.cjs +3 -3
  37. package/__cjs/react/context/ApolloContext.cjs +1 -1
  38. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  39. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
  40. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  41. package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
  42. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  43. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  44. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  45. package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
  46. package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
  47. package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
  48. package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
  49. package/__cjs/utilities/internal/capitalize.cjs +12 -0
  50. package/__cjs/utilities/internal/capitalize.cjs.map +1 -0
  51. package/__cjs/utilities/internal/capitalize.d.cts +7 -0
  52. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs +69 -0
  53. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs.map +1 -0
  54. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.d.cts +9 -0
  55. package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
  56. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
  57. package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
  58. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
  59. package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
  60. package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
  61. package/__cjs/utilities/internal/index.cjs +6 -2
  62. package/__cjs/utilities/internal/index.cjs.map +1 -1
  63. package/__cjs/utilities/internal/index.d.cts +2 -0
  64. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
  65. package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
  66. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
  67. package/__cjs/version.cjs +1 -1
  68. package/cache/core/cache.d.ts +19 -1
  69. package/cache/core/cache.js +26 -2
  70. package/cache/core/cache.js.map +1 -1
  71. package/cache/inmemory/entityStore.js +3 -3
  72. package/cache/inmemory/inMemoryCache.d.ts +5 -1
  73. package/cache/inmemory/inMemoryCache.js +10 -0
  74. package/cache/inmemory/inMemoryCache.js.map +1 -1
  75. package/cache/inmemory/key-extractor.js +1 -1
  76. package/cache/inmemory/policies.js +5 -5
  77. package/cache/inmemory/readFromStore.js +3 -3
  78. package/cache/inmemory/writeToStore.js +4 -4
  79. package/core/ApolloClient.js +14 -14
  80. package/core/ObservableQuery.d.ts +3 -6
  81. package/core/ObservableQuery.js +169 -61
  82. package/core/ObservableQuery.js.map +1 -1
  83. package/core/QueryInfo.d.ts +1 -25
  84. package/core/QueryInfo.js +11 -125
  85. package/core/QueryInfo.js.map +1 -1
  86. package/core/QueryManager.js +24 -16
  87. package/core/QueryManager.js.map +1 -1
  88. package/core/RefetchEventManager.js +3 -3
  89. package/incremental/handlers/graphql17Alpha9.js +1 -1
  90. package/incremental/handlers/notImplemented.js +1 -1
  91. package/invariantErrorCodes.js +141 -115
  92. package/link/core/ApolloLink.js +3 -3
  93. package/link/http/checkFetcher.js +1 -1
  94. package/link/http/parseAndCheckHttpResponse.js +2 -2
  95. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  96. package/link/persisted-queries/index.js +2 -2
  97. package/link/ws/index.js +1 -1
  98. package/local-state/LocalState.js +11 -11
  99. package/masking/maskDefinition.js +2 -2
  100. package/masking/maskFragment.js +2 -2
  101. package/masking/maskOperation.js +1 -1
  102. package/masking/utils.js +3 -3
  103. package/package.json +1 -1
  104. package/react/context/ApolloContext.js +1 -1
  105. package/react/context/ApolloProvider.js +1 -1
  106. package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
  107. package/react/hooks/useApolloClient.js +1 -1
  108. package/react/hooks/useLazyQuery.js +2 -2
  109. package/react/hooks/useLoadableQuery.js +2 -2
  110. package/react/hooks/useSubscription.js +1 -1
  111. package/react/hooks/useSyncExternalStore.js +1 -1
  112. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
  113. package/react/hooks-compiled/useApolloClient.js +1 -1
  114. package/react/hooks-compiled/useLazyQuery.js +2 -2
  115. package/react/hooks-compiled/useLoadableQuery.js +2 -2
  116. package/react/hooks-compiled/useSubscription.js +1 -1
  117. package/react/hooks-compiled/useSyncExternalStore.js +1 -1
  118. package/react/internal/cache/QueryReference.js +1 -1
  119. package/react/ssr/prerenderStatic.js +2 -2
  120. package/testing/core/mocking/mockLink.js +4 -4
  121. package/utilities/graphql/DocumentTransform.js +1 -1
  122. package/utilities/internal/capitalize.d.ts +7 -0
  123. package/utilities/internal/capitalize.js +9 -0
  124. package/utilities/internal/capitalize.js.map +1 -0
  125. package/utilities/internal/coerceScalarFieldsToParsed.d.ts +9 -0
  126. package/utilities/internal/coerceScalarFieldsToParsed.js +66 -0
  127. package/utilities/internal/coerceScalarFieldsToParsed.js.map +1 -0
  128. package/utilities/internal/getFragmentDefinition.js +3 -3
  129. package/utilities/internal/getFragmentFromSelection.js +1 -1
  130. package/utilities/internal/getFragmentFromSelection.js.map +1 -1
  131. package/utilities/internal/getFragmentQueryDocument.js +2 -2
  132. package/utilities/internal/getMainDefinition.js +1 -1
  133. package/utilities/internal/getQueryDefinition.js +1 -1
  134. package/utilities/internal/index.d.ts +2 -0
  135. package/utilities/internal/index.js +2 -0
  136. package/utilities/internal/index.js.map +1 -1
  137. package/utilities/internal/removeDirectivesFromDocument.js +1 -1
  138. package/utilities/internal/shouldInclude.js +4 -4
  139. package/utilities/internal/valueToObjectRepresentation.js +1 -1
  140. 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(104);
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(105, 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(106, source);
106
106
  }
107
107
  return;
108
108
  }
@@ -67,7 +67,7 @@ class IncrementalRequest {
67
67
  if (hasIncrementalChunks(chunk)) {
68
68
  for (const incremental of chunk.incremental) {
69
69
  const pending = this.pendingMap.get(incremental.id);
70
- invariant(pending, 66);
70
+ invariant(pending, 67);
71
71
  const path = pending.path.concat(incremental.subPath ?? []);
72
72
  let data;
73
73
  if ("items" in incremental) {
@@ -5,7 +5,7 @@ export class NotImplementedHandler {
5
5
  return false;
6
6
  }
7
7
  prepareRequest(request) {
8
- invariant(!hasDirectives(["defer", "stream"], request.query), 67);
8
+ invariant(!hasDirectives(["defer", "stream"], request.query), 68);
9
9
  return request;
10
10
  }
11
11
  extractErrors() { }