@apollo/client 3.7.5 → 3.7.6

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 (213) hide show
  1. package/apollo-client.cjs +102 -52
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/core/cache.d.ts +1 -1
  5. package/cache/core/cache.d.ts.map +1 -1
  6. package/cache/core/cache.js.map +1 -1
  7. package/cache/core/types/common.d.ts +7 -7
  8. package/cache/core/types/common.d.ts.map +1 -1
  9. package/cache/inmemory/entityStore.d.ts +1 -1
  10. package/cache/inmemory/entityStore.d.ts.map +1 -1
  11. package/cache/inmemory/helpers.js.map +1 -1
  12. package/cache/inmemory/inMemoryCache.d.ts +3 -2
  13. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  14. package/cache/inmemory/inMemoryCache.js.map +1 -1
  15. package/cache/inmemory/policies.d.ts +12 -12
  16. package/cache/inmemory/policies.d.ts.map +1 -1
  17. package/cache/inmemory/policies.js.map +1 -1
  18. package/cache/inmemory/reactiveVars.d.ts +1 -1
  19. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  20. package/cache/inmemory/readFromStore.d.ts +2 -2
  21. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  22. package/cache/inmemory/types.d.ts +4 -4
  23. package/cache/inmemory/types.d.ts.map +1 -1
  24. package/cache/inmemory/writeToStore.d.ts +1 -1
  25. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  26. package/cache/inmemory/writeToStore.js.map +1 -1
  27. package/core/ApolloClient.d.ts +5 -5
  28. package/core/ApolloClient.d.ts.map +1 -1
  29. package/core/ApolloClient.js.map +1 -1
  30. package/core/LocalState.d.ts +9 -6
  31. package/core/LocalState.d.ts.map +1 -1
  32. package/core/LocalState.js +61 -14
  33. package/core/LocalState.js.map +1 -1
  34. package/core/ObservableQuery.d.ts +5 -5
  35. package/core/ObservableQuery.d.ts.map +1 -1
  36. package/core/ObservableQuery.js +1 -1
  37. package/core/ObservableQuery.js.map +1 -1
  38. package/core/QueryInfo.d.ts +1 -1
  39. package/core/QueryInfo.d.ts.map +1 -1
  40. package/core/QueryManager.d.ts +7 -7
  41. package/core/QueryManager.d.ts.map +1 -1
  42. package/core/QueryManager.js +12 -9
  43. package/core/QueryManager.js.map +1 -1
  44. package/core/core.cjs +74 -24
  45. package/core/core.cjs.map +1 -1
  46. package/core/core.cjs.native.js +74 -24
  47. package/core/types.d.ts +16 -16
  48. package/core/types.d.ts.map +1 -1
  49. package/core/watchQueryOptions.d.ts +9 -9
  50. package/core/watchQueryOptions.d.ts.map +1 -1
  51. package/core/watchQueryOptions.js.map +1 -1
  52. package/errors/index.d.ts +2 -2
  53. package/errors/index.d.ts.map +1 -1
  54. package/invariantErrorCodes.js +48 -43
  55. package/link/batch/batch.cjs +5 -3
  56. package/link/batch/batch.cjs.map +1 -1
  57. package/link/batch/batch.cjs.native.js +5 -3
  58. package/link/batch/batching.d.ts +2 -2
  59. package/link/batch/batching.d.ts.map +1 -1
  60. package/link/batch/batching.js +5 -3
  61. package/link/batch/batching.js.map +1 -1
  62. package/link/context/index.d.ts +1 -1
  63. package/link/context/index.d.ts.map +1 -1
  64. package/link/core/ApolloLink.js +1 -1
  65. package/link/core/core.cjs +1 -1
  66. package/link/core/core.cjs.map +1 -1
  67. package/link/core/core.cjs.native.js +1 -1
  68. package/link/core/types.d.ts +6 -6
  69. package/link/core/types.d.ts.map +1 -1
  70. package/link/http/checkFetcher.js +1 -1
  71. package/link/http/createHttpLink.js.map +1 -1
  72. package/link/http/http.cjs +2 -2
  73. package/link/http/http.cjs.map +1 -1
  74. package/link/http/http.cjs.native.js +2 -2
  75. package/link/http/iterators/async.js.map +1 -1
  76. package/link/http/iterators/nodeStream.js.map +1 -1
  77. package/link/http/iterators/promise.js.map +1 -1
  78. package/link/http/iterators/reader.js.map +1 -1
  79. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  80. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  81. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  82. package/link/http/serializeFetchParameter.d.ts +1 -1
  83. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  84. package/link/http/serializeFetchParameter.js +1 -1
  85. package/link/persisted-queries/index.d.ts +2 -2
  86. package/link/persisted-queries/index.d.ts.map +1 -1
  87. package/link/persisted-queries/index.js +2 -2
  88. package/link/persisted-queries/persisted-queries.cjs +2 -2
  89. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  90. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  91. package/link/utils/throwServerError.d.ts +1 -1
  92. package/link/utils/throwServerError.d.ts.map +1 -1
  93. package/link/utils/utils.cjs +1 -1
  94. package/link/utils/utils.cjs.map +1 -1
  95. package/link/utils/utils.cjs.native.js +1 -1
  96. package/link/utils/validateOperation.js +1 -1
  97. package/package.json +9 -9
  98. package/react/components/Query.d.ts +2 -2
  99. package/react/components/Query.d.ts.map +1 -1
  100. package/react/components/Query.js.map +1 -1
  101. package/react/components/Subscription.d.ts +2 -2
  102. package/react/components/Subscription.d.ts.map +1 -1
  103. package/react/components/Subscription.js.map +1 -1
  104. package/react/components/types.d.ts +2 -2
  105. package/react/components/types.d.ts.map +1 -1
  106. package/react/components/types.js.map +1 -1
  107. package/react/context/ApolloConsumer.js +1 -1
  108. package/react/context/ApolloProvider.js +1 -1
  109. package/react/context/context.cjs +2 -2
  110. package/react/context/context.cjs.map +1 -1
  111. package/react/context/context.cjs.native.js +2 -2
  112. package/react/hoc/graphql.d.ts +2 -1
  113. package/react/hoc/graphql.d.ts.map +1 -1
  114. package/react/hoc/graphql.js.map +1 -1
  115. package/react/hoc/hoc-utils.d.ts +1 -1
  116. package/react/hoc/hoc-utils.d.ts.map +1 -1
  117. package/react/hoc/hoc-utils.js +1 -1
  118. package/react/hoc/hoc.cjs +2 -2
  119. package/react/hoc/hoc.cjs.map +1 -1
  120. package/react/hoc/hoc.cjs.native.js +2 -2
  121. package/react/hoc/mutation-hoc.d.ts +2 -2
  122. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  123. package/react/hoc/mutation-hoc.js.map +1 -1
  124. package/react/hoc/query-hoc.d.ts +1 -1
  125. package/react/hoc/query-hoc.d.ts.map +1 -1
  126. package/react/hoc/query-hoc.js.map +1 -1
  127. package/react/hoc/subscription-hoc.d.ts +1 -1
  128. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  129. package/react/hoc/subscription-hoc.js.map +1 -1
  130. package/react/hoc/types.d.ts +6 -6
  131. package/react/hoc/types.d.ts.map +1 -1
  132. package/react/hoc/types.js.map +1 -1
  133. package/react/hoc/withApollo.js +1 -1
  134. package/react/hooks/hooks.cjs +1 -1
  135. package/react/hooks/hooks.cjs.map +1 -1
  136. package/react/hooks/hooks.cjs.native.js +1 -1
  137. package/react/hooks/useApolloClient.js +1 -1
  138. package/react/hooks/useLazyQuery.d.ts +1 -1
  139. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  140. package/react/hooks/useLazyQuery.js.map +1 -1
  141. package/react/hooks/useQuery.d.ts +3 -3
  142. package/react/hooks/useQuery.d.ts.map +1 -1
  143. package/react/hooks/useQuery.js.map +1 -1
  144. package/react/hooks/useSubscription.d.ts +1 -1
  145. package/react/hooks/useSubscription.d.ts.map +1 -1
  146. package/react/hooks/useSubscription.js.map +1 -1
  147. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  148. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  149. package/react/parser/index.js +5 -5
  150. package/react/parser/parser.cjs +5 -5
  151. package/react/parser/parser.cjs.map +1 -1
  152. package/react/parser/parser.cjs.native.js +5 -5
  153. package/react/ssr/RenderPromises.d.ts +4 -4
  154. package/react/ssr/RenderPromises.d.ts.map +1 -1
  155. package/react/ssr/RenderPromises.js.map +1 -1
  156. package/react/ssr/getDataFromTree.d.ts +1 -1
  157. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  158. package/react/types/types.d.ts +17 -17
  159. package/react/types/types.d.ts.map +1 -1
  160. package/react/types/types.js.map +1 -1
  161. package/testing/core/core.cjs +1 -1
  162. package/testing/core/core.cjs.map +1 -1
  163. package/testing/core/core.cjs.native.js +1 -1
  164. package/testing/core/mocking/mockFetch.js.map +1 -1
  165. package/testing/core/mocking/mockLink.d.ts +1 -1
  166. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  167. package/testing/core/mocking/mockLink.js +1 -1
  168. package/testing/core/observableToPromise.d.ts +2 -2
  169. package/testing/core/observableToPromise.d.ts.map +1 -1
  170. package/testing/core/observableToPromise.js.map +1 -1
  171. package/utilities/common/cloneDeep.js.map +1 -1
  172. package/utilities/common/errorHandling.d.ts +2 -2
  173. package/utilities/common/errorHandling.d.ts.map +1 -1
  174. package/utilities/common/errorHandling.js.map +1 -1
  175. package/utilities/common/incrementalResult.d.ts +4 -4
  176. package/utilities/common/incrementalResult.d.ts.map +1 -1
  177. package/utilities/common/incrementalResult.js.map +1 -1
  178. package/utilities/common/mergeDeep.d.ts +2 -2
  179. package/utilities/common/mergeDeep.d.ts.map +1 -1
  180. package/utilities/common/mergeOptions.d.ts +2 -2
  181. package/utilities/common/mergeOptions.d.ts.map +1 -1
  182. package/utilities/common/mergeOptions.js.map +1 -1
  183. package/utilities/globals/globals.cjs +1 -1
  184. package/utilities/globals/globals.cjs.map +1 -1
  185. package/utilities/globals/globals.cjs.native.js +1 -1
  186. package/utilities/globals/index.js +1 -1
  187. package/utilities/graphql/directives.d.ts +2 -2
  188. package/utilities/graphql/directives.d.ts.map +1 -1
  189. package/utilities/graphql/directives.js +4 -4
  190. package/utilities/graphql/directives.js.map +1 -1
  191. package/utilities/graphql/fragments.d.ts +1 -1
  192. package/utilities/graphql/fragments.d.ts.map +1 -1
  193. package/utilities/graphql/fragments.js +3 -3
  194. package/utilities/graphql/getFromAST.js +8 -8
  195. package/utilities/graphql/storeUtils.d.ts +3 -3
  196. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  197. package/utilities/graphql/storeUtils.js +1 -1
  198. package/utilities/graphql/storeUtils.js.map +1 -1
  199. package/utilities/graphql/transform.d.ts +9 -9
  200. package/utilities/graphql/transform.d.ts.map +1 -1
  201. package/utilities/graphql/transform.js.map +1 -1
  202. package/utilities/observables/Concast.d.ts +5 -5
  203. package/utilities/observables/Concast.d.ts.map +1 -1
  204. package/utilities/observables/asyncMap.js.map +1 -1
  205. package/utilities/policies/pagination.d.ts +7 -7
  206. package/utilities/policies/pagination.d.ts.map +1 -1
  207. package/utilities/policies/pagination.js.map +1 -1
  208. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  209. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  210. package/utilities/utilities.cjs +16 -16
  211. package/utilities/utilities.cjs.map +1 -1
  212. package/utilities/utilities.cjs.native.js +16 -16
  213. package/version.js +1 -1
@@ -18,7 +18,7 @@ function shouldInclude(_a, variables) {
18
18
  var evaledValue = false;
19
19
  if (ifArgument.value.kind === 'Variable') {
20
20
  evaledValue = variables && variables[ifArgument.value.name.value];
21
- __DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 39);
21
+ __DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 40);
22
22
  }
23
23
  else {
24
24
  evaledValue = ifArgument.value.value;
@@ -65,13 +65,13 @@ function getInclusionDirectives(directives) {
65
65
  return;
66
66
  var directiveArguments = directive.arguments;
67
67
  var directiveName = directive.name.value;
68
- __DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 40);
68
+ __DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 41);
69
69
  var ifArgument = directiveArguments[0];
70
- __DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 41);
70
+ __DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 42);
71
71
  var ifValue = ifArgument.value;
72
72
  __DEV__ ? globals.invariant(ifValue &&
73
73
  (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value.")) : globals.invariant(ifValue &&
74
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 42);
74
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 43);
75
75
  result.push({ directive: directive, ifArgument: ifArgument });
76
76
  });
77
77
  }
@@ -84,14 +84,14 @@ function getFragmentQueryDocument(document, fragmentName) {
84
84
  document.definitions.forEach(function (definition) {
85
85
  if (definition.kind === 'OperationDefinition') {
86
86
  throw __DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
87
- 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(43);
87
+ 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(44);
88
88
  }
89
89
  if (definition.kind === 'FragmentDefinition') {
90
90
  fragments.push(definition);
91
91
  }
92
92
  });
93
93
  if (typeof actualFragmentName === 'undefined') {
94
- __DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1, 44);
94
+ __DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1, 45);
95
95
  actualFragmentName = fragments[0].name.value;
96
96
  }
97
97
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -132,7 +132,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
132
132
  return fragmentMap(fragmentName);
133
133
  }
134
134
  var fragment = fragmentMap && fragmentMap[fragmentName];
135
- __DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 45);
135
+ __DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 46);
136
136
  return fragment || null;
137
137
  }
138
138
  default:
@@ -216,7 +216,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
216
216
  else {
217
217
  throw __DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
218
218
  'is not supported. Use variables instead of inline arguments to ' +
219
- 'overcome this limitation.') : new globals.InvariantError(54);
219
+ 'overcome this limitation.') : new globals.InvariantError(55);
220
220
  }
221
221
  }
222
222
  function storeKeyNameFromField(field, variables) {
@@ -350,16 +350,16 @@ function isInlineFragment(selection) {
350
350
  }
351
351
 
352
352
  function checkDocument(doc) {
353
- __DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 46);
353
+ __DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 47);
354
354
  var operations = doc.definitions
355
355
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
356
356
  .map(function (definition) {
357
357
  if (definition.kind !== 'OperationDefinition') {
358
- throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(47);
358
+ throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(48);
359
359
  }
360
360
  return definition;
361
361
  });
362
- __DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 48);
362
+ __DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 49);
363
363
  return doc;
364
364
  }
365
365
  function getOperationDefinition(doc) {
@@ -378,14 +378,14 @@ function getFragmentDefinitions(doc) {
378
378
  }
379
379
  function getQueryDefinition(doc) {
380
380
  var queryDef = getOperationDefinition(doc);
381
- __DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 49);
381
+ __DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 50);
382
382
  return queryDef;
383
383
  }
384
384
  function getFragmentDefinition(doc) {
385
- __DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 50);
386
- __DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 51);
385
+ __DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 51);
386
+ __DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 52);
387
387
  var fragmentDef = doc.definitions[0];
388
- __DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 52);
388
+ __DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 53);
389
389
  return fragmentDef;
390
390
  }
391
391
  function getMainDefinition(queryDoc) {
@@ -408,7 +408,7 @@ function getMainDefinition(queryDoc) {
408
408
  if (fragmentDefinition) {
409
409
  return fragmentDefinition;
410
410
  }
411
- throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(53);
411
+ throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(54);
412
412
  }
413
413
  function getDefaultValues(definition) {
414
414
  var defaultValues = Object.create(null);
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = '3.7.5';
1
+ export var version = '3.7.6';
2
2
  //# sourceMappingURL=version.js.map