@apollo/client 4.0.0-rc.9 → 4.0.1

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 (209) hide show
  1. package/CHANGELOG.md +2484 -0
  2. package/README.md +6 -2
  3. package/__cjs/cache/inmemory/inMemoryCache.cjs +2 -2
  4. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  5. package/__cjs/cache/inmemory/policies.cjs +18 -12
  6. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  7. package/__cjs/core/ObservableQuery.cjs +3 -2
  8. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  9. package/__cjs/core/ObservableQuery.d.cts +1 -1
  10. package/__cjs/core/QueryManager.cjs +1 -1
  11. package/__cjs/core/QueryManager.cjs.map +1 -1
  12. package/__cjs/core/index.cjs +3 -2
  13. package/__cjs/core/index.cjs.map +1 -1
  14. package/__cjs/core/index.d.cts +5 -3
  15. package/__cjs/core/networkStatus.cjs +0 -16
  16. package/__cjs/core/networkStatus.cjs.map +1 -1
  17. package/__cjs/core/networkStatus.d.cts +0 -10
  18. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
  19. package/__cjs/incremental/handlers/defer20220824.d.cts +9 -6
  20. package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -1
  21. package/__cjs/incremental/handlers/notImplemented.d.cts +11 -0
  22. package/__cjs/invariantErrorCodes.cjs +12 -6
  23. package/__cjs/link/core/ApolloLink.cjs.map +1 -1
  24. package/__cjs/link/core/ApolloLink.d.cts +5 -2
  25. package/__cjs/link/core/types.d.cts +0 -4
  26. package/__cjs/link/index.cjs.map +1 -1
  27. package/__cjs/link/index.d.cts +2 -1
  28. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +2 -2
  29. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  30. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +2 -2
  31. package/__cjs/local-state/LocalState.cjs.map +1 -1
  32. package/__cjs/masking/GraphQLCodegenDataMasking.d.cts +10 -42
  33. package/__cjs/masking/PreserveTypes.cjs +3 -0
  34. package/__cjs/masking/PreserveTypes.cjs.map +1 -0
  35. package/__cjs/masking/PreserveTypes.d.cts +26 -0
  36. package/__cjs/masking/index.cjs.map +1 -1
  37. package/__cjs/masking/index.d.cts +1 -1
  38. package/__cjs/masking/internal/types.d.cts +0 -1
  39. package/__cjs/masking/types.d.cts +6 -23
  40. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  41. package/__cjs/react/hooks/useBackgroundQuery.d.cts +2 -1
  42. package/__cjs/react/hooks/useLazyQuery.d.cts +1 -1
  43. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  44. package/__cjs/react/hooks/useLoadableQuery.d.cts +2 -1
  45. package/__cjs/react/hooks/useQuery.d.cts +1 -1
  46. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  47. package/__cjs/react/hooks/useQueryRefHandlers.d.cts +2 -1
  48. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  49. package/__cjs/react/hooks/useReadQuery.d.cts +1 -1
  50. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  51. package/__cjs/react/query-preloader/createQueryPreloader.d.cts +1 -1
  52. package/__cjs/react/types/deprecated.d.cts +1 -1
  53. package/__cjs/react/types/types.documentation.d.cts +1 -1
  54. package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +1 -1
  55. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  56. package/__cjs/testing/react/MockedProvider.d.cts +5 -0
  57. package/__cjs/utilities/common/stripTypename.cjs +11 -0
  58. package/__cjs/utilities/common/stripTypename.cjs.map +1 -1
  59. package/__cjs/utilities/common/stripTypename.d.cts +11 -0
  60. package/__cjs/utilities/graphql/DocumentTransform.cjs +84 -1
  61. package/__cjs/utilities/graphql/DocumentTransform.cjs.map +1 -1
  62. package/__cjs/utilities/graphql/DocumentTransform.d.cts +94 -5
  63. package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs +27 -0
  64. package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs.map +1 -1
  65. package/__cjs/utilities/graphql/isFormattedExecutionResult.d.cts +27 -0
  66. package/__cjs/utilities/graphql/operations.cjs +54 -3
  67. package/__cjs/utilities/graphql/operations.cjs.map +1 -1
  68. package/__cjs/utilities/graphql/operations.d.cts +54 -3
  69. package/__cjs/utilities/graphql/storeUtils.cjs +9 -0
  70. package/__cjs/utilities/graphql/storeUtils.cjs.map +1 -1
  71. package/__cjs/utilities/graphql/storeUtils.d.cts +9 -0
  72. package/__cjs/utilities/graphql/transform.cjs +12 -1
  73. package/__cjs/utilities/graphql/transform.cjs.map +1 -1
  74. package/__cjs/utilities/graphql/transform.d.cts +12 -1
  75. package/__cjs/utilities/index.cjs +5 -1
  76. package/__cjs/utilities/index.cjs.map +1 -1
  77. package/__cjs/utilities/index.d.cts +2 -0
  78. package/__cjs/utilities/internal/canonicalStringify.cjs +30 -7
  79. package/__cjs/utilities/internal/canonicalStringify.cjs.map +1 -1
  80. package/__cjs/utilities/internal/canonicalStringify.d.cts +30 -7
  81. package/__cjs/utilities/internal/getMainDefinition.cjs +36 -8
  82. package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -1
  83. package/__cjs/utilities/internal/getMainDefinition.d.cts +36 -8
  84. package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +1 -1
  85. package/__cjs/utilities/isNetworkRequestInFlight.cjs +12 -0
  86. package/__cjs/utilities/isNetworkRequestInFlight.cjs.map +1 -0
  87. package/__cjs/utilities/isNetworkRequestInFlight.d.cts +7 -0
  88. package/__cjs/utilities/isNetworkRequestSettled.cjs +11 -0
  89. package/__cjs/utilities/isNetworkRequestSettled.cjs.map +1 -0
  90. package/__cjs/utilities/isNetworkRequestSettled.d.cts +7 -0
  91. package/__cjs/v4-migration.cjs +9 -0
  92. package/__cjs/v4-migration.cjs.map +1 -0
  93. package/__cjs/v4-migration.d.cts +826 -0
  94. package/__cjs/version.cjs +1 -1
  95. package/__cjs/version.cjs.map +1 -1
  96. package/cache/inmemory/inMemoryCache.js +2 -2
  97. package/cache/inmemory/inMemoryCache.js.map +1 -1
  98. package/cache/inmemory/policies.js +18 -12
  99. package/cache/inmemory/policies.js.map +1 -1
  100. package/core/ObservableQuery.d.ts +1 -1
  101. package/core/ObservableQuery.js +2 -1
  102. package/core/ObservableQuery.js.map +1 -1
  103. package/core/QueryManager.js +2 -2
  104. package/core/QueryManager.js.map +1 -1
  105. package/core/index.d.ts +5 -3
  106. package/core/index.js +4 -2
  107. package/core/index.js.map +1 -1
  108. package/core/networkStatus.d.ts +0 -10
  109. package/core/networkStatus.js +0 -14
  110. package/core/networkStatus.js.map +1 -1
  111. package/incremental/handlers/defer20220824.d.ts +9 -6
  112. package/incremental/handlers/defer20220824.js.map +1 -1
  113. package/incremental/handlers/notImplemented.d.ts +11 -0
  114. package/incremental/handlers/notImplemented.js.map +1 -1
  115. package/invariantErrorCodes.js +2 -2
  116. package/legacyEntryPoints/v4-migration/index.d.ts +1 -0
  117. package/legacyEntryPoints/v4-migration/index.js +1 -0
  118. package/legacyEntryPoints/v4-migration/v4-migration.cjs +1 -0
  119. package/legacyEntryPoints/v4-migration/v4-migration.d.cts +1 -0
  120. package/link/core/ApolloLink.d.ts +5 -2
  121. package/link/core/ApolloLink.js.map +1 -1
  122. package/link/core/types.d.ts +0 -4
  123. package/link/core/types.js.map +1 -1
  124. package/link/index.d.ts +2 -1
  125. package/link/index.js.map +1 -1
  126. package/link/remove-typename/removeTypenameFromVariables.d.ts +2 -2
  127. package/link/remove-typename/removeTypenameFromVariables.js +2 -2
  128. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  129. package/local-state/LocalState.js.map +1 -1
  130. package/masking/GraphQLCodegenDataMasking.d.ts +10 -42
  131. package/masking/GraphQLCodegenDataMasking.js.map +1 -1
  132. package/masking/PreserveTypes.d.ts +26 -0
  133. package/masking/PreserveTypes.js +2 -0
  134. package/masking/PreserveTypes.js.map +1 -0
  135. package/masking/index.d.ts +1 -1
  136. package/masking/index.js.map +1 -1
  137. package/masking/internal/types.d.ts +0 -1
  138. package/masking/internal/types.js.map +1 -1
  139. package/masking/types.d.ts +6 -23
  140. package/masking/types.js.map +1 -1
  141. package/package.json +8 -2
  142. package/react/hooks/useBackgroundQuery.d.ts +2 -1
  143. package/react/hooks/useBackgroundQuery.js.map +1 -1
  144. package/react/hooks/useLazyQuery.d.ts +1 -1
  145. package/react/hooks/useLoadableQuery.d.ts +2 -1
  146. package/react/hooks/useLoadableQuery.js.map +1 -1
  147. package/react/hooks/useQuery.d.ts +1 -1
  148. package/react/hooks/useQueryRefHandlers.d.ts +2 -1
  149. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  150. package/react/hooks/useReadQuery.d.ts +1 -1
  151. package/react/hooks/useReadQuery.js.map +1 -1
  152. package/react/hooks-compiled/useBackgroundQuery.d.ts +2 -1
  153. package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
  154. package/react/hooks-compiled/useLazyQuery.d.ts +1 -1
  155. package/react/hooks-compiled/useLoadableQuery.d.ts +2 -1
  156. package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
  157. package/react/hooks-compiled/useQuery.d.ts +1 -1
  158. package/react/hooks-compiled/useQueryRefHandlers.d.ts +2 -1
  159. package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
  160. package/react/hooks-compiled/useReadQuery.d.ts +1 -1
  161. package/react/hooks-compiled/useReadQuery.js.map +1 -1
  162. package/react/query-preloader/createQueryPreloader.d.ts +1 -1
  163. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  164. package/react/types/deprecated.d.ts +1 -1
  165. package/react/types/deprecated.js.map +1 -1
  166. package/react/types/types.documentation.d.ts +1 -1
  167. package/react/types/types.documentation.js.map +1 -1
  168. package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
  169. package/testing/react/MockedProvider.d.ts +5 -0
  170. package/testing/react/MockedProvider.js.map +1 -1
  171. package/utilities/common/stripTypename.d.ts +11 -0
  172. package/utilities/common/stripTypename.js +11 -0
  173. package/utilities/common/stripTypename.js.map +1 -1
  174. package/utilities/graphql/DocumentTransform.d.ts +94 -5
  175. package/utilities/graphql/DocumentTransform.js +84 -1
  176. package/utilities/graphql/DocumentTransform.js.map +1 -1
  177. package/utilities/graphql/isFormattedExecutionResult.d.ts +27 -0
  178. package/utilities/graphql/isFormattedExecutionResult.js +27 -0
  179. package/utilities/graphql/isFormattedExecutionResult.js.map +1 -1
  180. package/utilities/graphql/operations.d.ts +54 -3
  181. package/utilities/graphql/operations.js +54 -3
  182. package/utilities/graphql/operations.js.map +1 -1
  183. package/utilities/graphql/storeUtils.d.ts +9 -0
  184. package/utilities/graphql/storeUtils.js +9 -0
  185. package/utilities/graphql/storeUtils.js.map +1 -1
  186. package/utilities/graphql/transform.d.ts +12 -1
  187. package/utilities/graphql/transform.js +12 -1
  188. package/utilities/graphql/transform.js.map +1 -1
  189. package/utilities/index.d.ts +2 -0
  190. package/utilities/index.js +2 -0
  191. package/utilities/index.js.map +1 -1
  192. package/utilities/internal/canonicalStringify.d.ts +30 -7
  193. package/utilities/internal/canonicalStringify.js +30 -7
  194. package/utilities/internal/canonicalStringify.js.map +1 -1
  195. package/utilities/internal/getMainDefinition.d.ts +37 -9
  196. package/utilities/internal/getMainDefinition.js +36 -8
  197. package/utilities/internal/getMainDefinition.js.map +1 -1
  198. package/utilities/internal/types/DocumentationTypes.d.ts +1 -1
  199. package/utilities/isNetworkRequestInFlight.d.ts +7 -0
  200. package/utilities/isNetworkRequestInFlight.js +9 -0
  201. package/utilities/isNetworkRequestInFlight.js.map +1 -0
  202. package/utilities/isNetworkRequestSettled.d.ts +7 -0
  203. package/utilities/isNetworkRequestSettled.js +8 -0
  204. package/utilities/isNetworkRequestSettled.js.map +1 -0
  205. package/v4-migration.d.ts +826 -0
  206. package/v4-migration.js +8 -0
  207. package/v4-migration.js.map +1 -0
  208. package/version.js +1 -1
  209. package/version.js.map +1 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true if the network request is in ready or error state according to a given network
3
+ * status.
4
+ */
5
+ export function isNetworkRequestSettled(networkStatus) {
6
+ return networkStatus === 7 || networkStatus === 8;
7
+ }
8
+ //# sourceMappingURL=isNetworkRequestSettled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNetworkRequestSettled.js","sourceRoot":"","sources":["../../src/utilities/isNetworkRequestSettled.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACrC,aAA6B;IAE7B,OAAO,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import type { NetworkStatus } from \"@apollo/client\";\n\n/**\n * Returns true if the network request is in ready or error state according to a given network\n * status.\n */\nexport function isNetworkRequestSettled(\n networkStatus?: NetworkStatus\n): boolean {\n return networkStatus === 7 || networkStatus === 8;\n}\n"]}