@shopify/hydrogen 0.25.1 → 0.27.0

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 (143) hide show
  1. package/CHANGELOG.md +127 -5
  2. package/dist/esnext/components/{CartEstimatedCost/CartEstimatedCost.client.d.ts → CartCost/CartCost.client.d.ts} +3 -3
  3. package/dist/esnext/components/{CartEstimatedCost/CartEstimatedCost.client.js → CartCost/CartCost.client.js} +7 -7
  4. package/dist/esnext/components/CartCost/index.d.ts +1 -0
  5. package/dist/esnext/components/CartCost/index.js +1 -0
  6. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +2 -2
  7. package/dist/esnext/components/CartLineProvider/context.d.ts +3 -3
  8. package/dist/esnext/components/CartProvider/CartProvider.client.js +37 -27
  9. package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
  10. package/dist/esnext/components/CartProvider/cart-queries.js +3 -3
  11. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +5 -5
  12. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +5 -5
  13. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +5 -5
  14. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +5 -5
  15. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +5 -5
  16. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +5 -5
  17. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +5 -5
  18. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +5 -5
  19. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +5 -5
  20. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +5 -5
  21. package/dist/esnext/components/CartProvider/hooks.client.d.ts +1 -1
  22. package/dist/esnext/components/CartProvider/hooks.client.js +16 -11
  23. package/dist/esnext/components/CartProvider/types.d.ts +3 -3
  24. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +1 -3
  25. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +2 -4
  26. package/dist/esnext/components/Link/Link.client.d.ts +2 -0
  27. package/dist/esnext/components/Link/Link.client.js +14 -7
  28. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +2 -2
  29. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +1 -1
  30. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -3
  31. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +8 -20
  32. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +16 -33
  33. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  34. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  35. package/dist/esnext/components/Metafield/Metafield.client.js +3 -3
  36. package/dist/esnext/components/Money/Money.client.d.ts +1 -1
  37. package/dist/esnext/components/Money/Money.client.js +1 -1
  38. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +3 -3
  39. package/dist/esnext/components/Seo/DescriptionSeo.client.js +1 -1
  40. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +1 -1
  41. package/dist/esnext/components/Seo/HomePageSeo.client.js +3 -3
  42. package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
  43. package/dist/esnext/components/Seo/NoIndexSeo.client.js +3 -3
  44. package/dist/esnext/components/Seo/ProductSeo.client.js +2 -2
  45. package/dist/esnext/components/Seo/Seo.client.js +1 -1
  46. package/dist/esnext/components/Seo/TitleSeo.client.js +1 -1
  47. package/dist/esnext/components/Seo/TwitterSeo.client.js +1 -1
  48. package/dist/esnext/components/Seo/seo-types.d.ts +1 -0
  49. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +3 -1
  50. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +8 -3
  51. package/dist/esnext/components/index.d.ts +2 -2
  52. package/dist/esnext/components/index.js +2 -2
  53. package/dist/esnext/constants.d.ts +1 -1
  54. package/dist/esnext/constants.js +1 -1
  55. package/dist/esnext/entry-client.js +7 -5
  56. package/dist/esnext/entry-server.js +40 -40
  57. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +31 -16
  58. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +20 -3
  59. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +1 -1
  60. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +1 -1
  61. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +3 -23
  62. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +1 -1
  63. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +3 -17
  64. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +5 -13
  65. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +20 -0
  66. package/dist/esnext/foundation/DevTools/DevTools.server.js +2 -2
  67. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +1 -1
  68. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +9 -1
  69. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +6 -0
  70. package/dist/esnext/foundation/Route/Route.server.js +1 -1
  71. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +1 -1
  72. package/dist/esnext/foundation/Router/BrowserRouter.client.js +7 -5
  73. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -4
  74. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +9 -7
  75. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +9 -5
  76. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +4 -3
  77. package/dist/esnext/foundation/constants.d.ts +2 -1
  78. package/dist/esnext/foundation/constants.js +2 -1
  79. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
  80. package/dist/esnext/foundation/useNavigate/useNavigate.js +19 -0
  81. package/dist/esnext/foundation/useQuery/hooks.js +1 -4
  82. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +3 -0
  83. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +8 -3
  84. package/dist/esnext/foundation/useUrl/useUrl.js +5 -3
  85. package/dist/esnext/framework/cache/in-memory.d.ts +12 -7
  86. package/dist/esnext/framework/cache/in-memory.js +49 -21
  87. package/dist/esnext/framework/load-config.d.ts +5 -0
  88. package/dist/esnext/framework/load-config.js +7 -0
  89. package/dist/esnext/framework/plugin.js +1 -1
  90. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.js +2 -3
  91. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +2 -2
  92. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -1
  93. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +2 -1
  94. package/dist/esnext/framework/types.d.ts +1 -0
  95. package/dist/esnext/framework/viteception.d.ts +2 -1
  96. package/dist/esnext/framework/viteception.js +2 -1
  97. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +3 -3
  98. package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +4 -0
  99. package/dist/esnext/hooks/useLocalization/useLocalization.js +14 -0
  100. package/dist/esnext/hooks/useMeasurement/hooks.js +2 -2
  101. package/dist/esnext/hooks/useMoney/hooks.d.ts +1 -1
  102. package/dist/esnext/hooks/useMoney/hooks.js +2 -2
  103. package/dist/esnext/index.d.ts +3 -0
  104. package/dist/esnext/index.js +1 -0
  105. package/dist/esnext/platforms/node.d.ts +1 -1
  106. package/dist/esnext/platforms/node.js +2 -1
  107. package/dist/esnext/shared-types.d.ts +2 -1
  108. package/dist/esnext/storefront-api-types.d.ts +105 -3
  109. package/dist/esnext/storefront-api-types.js +8 -0
  110. package/dist/esnext/types.d.ts +11 -1
  111. package/dist/esnext/utilities/apiRoutes.d.ts +4 -3
  112. package/dist/esnext/utilities/image_size.js +11 -0
  113. package/dist/esnext/utilities/log/log-cache-api-status.js +3 -0
  114. package/dist/esnext/utilities/storefrontApi.d.ts +1 -0
  115. package/dist/esnext/utilities/storefrontApi.js +1 -1
  116. package/dist/esnext/version.d.ts +1 -1
  117. package/dist/esnext/version.js +1 -1
  118. package/dist/node/framework/cache/in-memory.d.ts +12 -7
  119. package/dist/node/framework/cache/in-memory.js +49 -21
  120. package/dist/node/framework/load-config.d.ts +5 -0
  121. package/dist/node/framework/load-config.js +11 -0
  122. package/dist/node/framework/plugin.js +1 -1
  123. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.js +2 -3
  124. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +2 -2
  125. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -1
  126. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +2 -1
  127. package/dist/node/framework/types.d.ts +1 -0
  128. package/dist/node/framework/viteception.d.ts +2 -1
  129. package/dist/node/framework/viteception.js +2 -1
  130. package/dist/node/shared-types.d.ts +2 -1
  131. package/package.json +13 -3
  132. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +46 -17
  133. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +18 -3
  134. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +2 -2
  135. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +2 -1
  136. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +46 -17
  137. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +18 -3
  138. package/dist/esnext/components/CartEstimatedCost/index.d.ts +0 -1
  139. package/dist/esnext/components/CartEstimatedCost/index.js +0 -1
  140. package/dist/esnext/hooks/useCountry/index.d.ts +0 -1
  141. package/dist/esnext/hooks/useCountry/index.js +0 -1
  142. package/dist/esnext/hooks/useCountry/useCountry.d.ts +0 -7
  143. package/dist/esnext/hooks/useCountry/useCountry.js +0 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1697](https://github.com/Shopify/hydrogen/pull/1697) [`85aab092`](https://github.com/Shopify/hydrogen/commit/85aab092b2f47d77bb917659918a011783cd8c34) Thanks [@blittle](https://github.com/blittle)! - Remove `defaultLocale` from the Hydrogen Config and instead add `defaultCountryCode` and `defaultLanguageCode`. Both of which are also now available by the `useShop()` hook:
8
+
9
+ ```diff
10
+ export default defineConfig({
11
+ shopify: {
12
+ - defaultLocale: 'EN-US',
13
+ + defaultCountryCode: 'US',
14
+ + defaultLanguageCode: 'EN',
15
+ storeDomain: 'hydrogen-preview.myshopify.com',
16
+ storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
17
+ storefrontApiVersion: '2022-07',
18
+ },
19
+ }
20
+ ```
21
+
22
+ * [#1662](https://github.com/Shopify/hydrogen/pull/1662) [`4262b319`](https://github.com/Shopify/hydrogen/commit/4262b3196afb96415d3b0f8f874f351030e6a734) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fix server analytics route
23
+
24
+ - Fix ServerAnalyticsRoute so that it does complete all async work
25
+ - Move Performance and Shopify analytic reporting to client side
26
+ - Make sure `ShopifyAnalytics` make its own query for shop id and currency
27
+ - Remove query for shop id and currency from `DefaultSeo` component
28
+ - Make Performance and Shopify server analytics connector do nothing
29
+
30
+ ### Deprecated components
31
+
32
+ Remove the following components from `hydrogen.config.js`
33
+
34
+ - `PerformanceMetricsServerAnalyticsConnector`
35
+ - `ShopifyServerAnalyticsConnector`
36
+
37
+ ## 0.26.1
38
+
39
+ ### Patch Changes
40
+
41
+ - [#1663](https://github.com/Shopify/hydrogen/pull/1663) [`66200d6b`](https://github.com/Shopify/hydrogen/commit/66200d6b7d8e54b0746a048e950f067d4b8e0609) Thanks [@jplhomer](https://github.com/jplhomer)! - Default to 'US' CountryCode if locale cannot be parsed correctly
42
+
43
+ * [#1690](https://github.com/Shopify/hydrogen/pull/1690) [`afde8989`](https://github.com/Shopify/hydrogen/commit/afde8989ae03e842de65ac698ab86033e56e7ee2) Thanks [@frehner](https://github.com/frehner)! - Add scale to the filename part of the url in `shopifyImageLoader()`
44
+
45
+ - [#1676](https://github.com/Shopify/hydrogen/pull/1676) [`0149cbf6`](https://github.com/Shopify/hydrogen/commit/0149cbf60b331461ae0c97bb3e18d3f27e143d0a) Thanks [@frandiox](https://github.com/frandiox)! - Avoid writing to Node response if it has been closed early.
46
+
47
+ * [#1674](https://github.com/Shopify/hydrogen/pull/1674) [`8068d3ce`](https://github.com/Shopify/hydrogen/commit/8068d3ce14f44ea83bde8f3729ae2a8cbbf8a52e) Thanks [@frandiox](https://github.com/frandiox)! - Throw error when `<Link>` component is used outside of `<Router>` component.
48
+
49
+ - [#1680](https://github.com/Shopify/hydrogen/pull/1680) [`acf5223f`](https://github.com/Shopify/hydrogen/commit/acf5223fe34cfdd483ae9b0e714445c8cbf11a9d) Thanks [@blittle](https://github.com/blittle)! - Fix basepath to not apply to external URLs in the `<Link` component. Also default the attribute `rel="noreferrer noopener` for external URLs.
50
+
51
+ * [#1670](https://github.com/Shopify/hydrogen/pull/1670) [`8b26f7a6`](https://github.com/Shopify/hydrogen/commit/8b26f7a6f034eaa36bb11974ff3dc5d992e2e97b) Thanks [@frandiox](https://github.com/frandiox)! - Optimize client boundaries only during build by default.
52
+
53
+ ## 0.26.0
54
+
55
+ ### Minor Changes
56
+
57
+ - [#1615](https://github.com/Shopify/hydrogen/pull/1615) [`20bfc438`](https://github.com/Shopify/hydrogen/commit/20bfc4388ed400dc215a41cca44fe8cd4a11022a) Thanks [@frehner](https://github.com/frehner)! - `<CartEstimatedCost/>` has been renamed to `<CartCost/>` to match a recent update to the Storefront API, in which `cart.estimatedCost` is being deprecated in favor of `cart.cost`.
58
+
59
+ Additionally, `cart.cost.compareAtAmount` was renamed to `cart.cost.compareAtAmountPerQuantity`.
60
+
61
+ * [#1619](https://github.com/Shopify/hydrogen/pull/1619) [`b0c13696`](https://github.com/Shopify/hydrogen/commit/b0c13696b6030ab8697147fdbe3ccdf2522a3913) Thanks [@blittle](https://github.com/blittle)! - We have reworked how localization works in Hydrogen. By default the `useLocalization()` hook returns the default locale defined within your [Hydrogen configuration file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config). The `<LocalizationProvider>` component now takes `countryCode` and `languageCode` as optional props. Any props given to `<LocalizationProvider>` will also be used by the `useLocalization` hook.
62
+
63
+ **Breaking Change**
64
+
65
+ The `useCountry` hook has been removed. Instead use the [`useLocalization` hook](https://shopify.dev/api/hydrogen/hooks/localization/uselocalization).
66
+
67
+ ```diff
68
+ - import {useCountry, gql} from '@shopify/hydrogen';
69
+ + import {useLocalization, gql} from '@shopify/hydrogen';
70
+
71
+ export function MyComponent() {
72
+
73
+ - const [country] = useCountry();
74
+ + const {country} = useLocalization();
75
+
76
+ return ( /* Your JSX */ );
77
+ }
78
+ ```
79
+
80
+ The `Link` component now respects the `basePath` property defined within it's parent `FileRoutes` component. For example, given `<FileRoutes basePath="/cn">`, a route within that renders `<Link to="/products">` will actually produce an anchor tag prefixed with `/cn`: `<a href="/cn/products">`. You can override the `basePath` with a `basePath` prop on the `Link` component.
81
+
82
+ - [#1646](https://github.com/Shopify/hydrogen/pull/1646) [`1103fb57`](https://github.com/Shopify/hydrogen/commit/1103fb575e51d5948c6bd4885bcd911be1f8bf7e) Thanks [@benjaminsehl](https://github.com/benjaminsehl)! - Updates default SEO titleTemplate for the Homepage
83
+
84
+ ### Patch Changes
85
+
86
+ - [#1569](https://github.com/Shopify/hydrogen/pull/1569) [`e5896a3e`](https://github.com/Shopify/hydrogen/commit/e5896a3e20b0bf2760b238e713a7bc04f7e95e2d) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Clean up full page cache work with `waitUntil`
87
+
88
+ * [#1643](https://github.com/Shopify/hydrogen/pull/1643) [`3b849606`](https://github.com/Shopify/hydrogen/commit/3b849606c4999d19920330f86c535a6f892dcc65) Thanks [@frandiox](https://github.com/frandiox)! - Do not cache client components in browser when using TypeScript.
89
+
90
+ - [#1605](https://github.com/Shopify/hydrogen/pull/1605) [`2eb2c461`](https://github.com/Shopify/hydrogen/commit/2eb2c4615210cafadab8ed154909f3516c72db3e) Thanks [@frandiox](https://github.com/frandiox)! - Fix hydration issues with `useId`.
91
+
92
+ * [#1613](https://github.com/Shopify/hydrogen/pull/1613) [`c45ebd3c`](https://github.com/Shopify/hydrogen/commit/c45ebd3cf468c9f596ef399712506bd766dea54d) Thanks [@frehner](https://github.com/frehner)! - The `<ShopPayButton/>` and `<CartShopPayButton/>` now take in a `width` prop to help customize how wide the `<shop-pay-button>` custom element is, by using the newly added CSS custom property (variable) `--shop-pay-button-width`.
93
+
94
+ - [#1651](https://github.com/Shopify/hydrogen/pull/1651) [`a19be2b2`](https://github.com/Shopify/hydrogen/commit/a19be2b22cee63bf95ade3a4f5803c460651a473) Thanks [@blittle](https://github.com/blittle)! - Fixes to the cart:
95
+
96
+ 1. Fix bug when providing a lower-case country code to the `LocalizationProvider`
97
+ 2. Make sure that the Cart always logs API errors
98
+
99
+ * [#1649](https://github.com/Shopify/hydrogen/pull/1649) [`df0e01ff`](https://github.com/Shopify/hydrogen/commit/df0e01fff6afae22a30be8c0bb750aed016326a4) Thanks [@blittle](https://github.com/blittle)! - Add a `x-powered-by: Shopify-Hydrogen` header which can be disabled with the Hydrogen config property: `poweredByHeader: false`
100
+
101
+ - [#1566](https://github.com/Shopify/hydrogen/pull/1566) [`cfe7385e`](https://github.com/Shopify/hydrogen/commit/cfe7385e0c64c3dc465d1bcd34ad9c7040db9969) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Add storefont id to cart provider query
102
+
103
+ * [#1551](https://github.com/Shopify/hydrogen/pull/1551) [`3d20e92d`](https://github.com/Shopify/hydrogen/commit/3d20e92db3402e356c16d0bc5fc4450f9d8c0df5) Thanks [@jplhomer](https://github.com/jplhomer)! - In-Memory caching is now enabled by default in production for Node.js runtimes.
104
+
105
+ - [#1604](https://github.com/Shopify/hydrogen/pull/1604) [`f3827d31`](https://github.com/Shopify/hydrogen/commit/f3827d31263352689c5149a5509b51d1fdb572d4) Thanks [@cartogram](https://github.com/cartogram)! - Adds new `load-config` entry point that exposes a `loadConfig()` function that will return the configuration object and the path to the found configuration file for a given Hydrogen project root.
106
+
107
+ Example:
108
+
109
+ ```ts
110
+ import {loadConfig} from '@shopify/hydrogen/load-config';
111
+
112
+ const {configuration, configurationPath} = await loadConfig({
113
+ root: 'path/to/hydrogen-app',
114
+ });
115
+ ```
116
+
117
+ * [#1626](https://github.com/Shopify/hydrogen/pull/1626) [`29218452`](https://github.com/Shopify/hydrogen/commit/29218452a1679be629616993d8cc23ad7077667b) Thanks [@frandiox](https://github.com/frandiox)! - Fix import aliases.
118
+
119
+ - [#1622](https://github.com/Shopify/hydrogen/pull/1622) [`d339239d`](https://github.com/Shopify/hydrogen/commit/d339239d23b074cba3ee637166f8120512a6afee) Thanks [@frandiox](https://github.com/frandiox)! - Fix module resolution after HMR in some scenarios.
120
+
121
+ * [#1608](https://github.com/Shopify/hydrogen/pull/1608) [`b834dfdc`](https://github.com/Shopify/hydrogen/commit/b834dfdcddc56c78bb6fbb7e0a681cc3c977b62d) Thanks [@jplhomer](https://github.com/jplhomer)! - Add type exports for `HydrogenRouteProps`, `HydrogenApiRoute`, and `HydrogenApiRouteOptions`.
122
+
123
+ - [#1603](https://github.com/Shopify/hydrogen/pull/1603) [`e1bb5810`](https://github.com/Shopify/hydrogen/commit/e1bb5810f218acc5b7debb60bcdebc6c9594f86c) Thanks [@frandiox](https://github.com/frandiox)! - Do not trigger prefetch when `to` prop is missing in the `Link` component.
124
+
3
125
  ## 0.25.1
4
126
 
5
127
  ## 0.25.0
@@ -1453,11 +1575,11 @@
1453
1575
 
1454
1576
  `queryShop` accepts a single argument object with the following properties:
1455
1577
 
1456
- | Property | Type | Required |
1457
- | ----------- | -------------------------------------- | -------- |
1458
- | `query` | `string \| ASTNode` | Yes |
1459
- | `variables` | `Record<string, any>` | No |
1460
- | `locale` | `string` (defaults to `defaultLocale`) | No |
1578
+ | Property | Type | Required |
1579
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
1580
+ | `query` | `string \| ASTNode` | Yes |
1581
+ | `variables` | `Record<string, any>` | No |
1582
+ | `locale` | `string`. Defaults to the locale value from the [LocalizationProvider](https://shopify.dev/api/hydrogen/components/localization/localizationprovider) component. | No |
1461
1583
 
1462
1584
  **Important**: In order to use `queryShop`, you should pass `shopifyConfig` to `renderHydrogen` inside `App.server.jsx`:
1463
1585
 
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Money } from '../Money';
3
- export interface CartEstimatedCostProps {
3
+ export interface CartCostProps {
4
4
  /** A string type that defines the type of cost needed. Valid values: `total`, `subtotal`, `tax`, or `duty`. */
5
5
  amountType?: 'total' | 'subtotal' | 'tax' | 'duty';
6
6
  /** A function that takes an object return by the `useMoney` hook and returns a `ReactNode`. */
7
7
  children?: React.ReactNode;
8
8
  }
9
9
  /**
10
- * The `CartEstimatedCost` component renders a `Money` component with the
10
+ * The `CartCost` component renders a `Money` component with the
11
11
  * cost associated with the `amountType` prop. If no `amountType` prop is specified, then it defaults to `totalAmount`.
12
12
  * If `children` is a function, then it will pass down the render props provided by the parent component.
13
13
  */
14
- export declare function CartEstimatedCost(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartEstimatedCostProps): JSX.Element | null;
14
+ export declare function CartCost(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartCostProps): JSX.Element | null;
@@ -2,25 +2,25 @@ import React from 'react';
2
2
  import { useCart } from '../CartProvider';
3
3
  import { Money } from '../Money';
4
4
  /**
5
- * The `CartEstimatedCost` component renders a `Money` component with the
5
+ * The `CartCost` component renders a `Money` component with the
6
6
  * cost associated with the `amountType` prop. If no `amountType` prop is specified, then it defaults to `totalAmount`.
7
7
  * If `children` is a function, then it will pass down the render props provided by the parent component.
8
8
  */
9
- export function CartEstimatedCost(props) {
10
- const { estimatedCost } = useCart();
9
+ export function CartCost(props) {
10
+ const { cost } = useCart();
11
11
  const { amountType = 'total', children, ...passthroughProps } = props;
12
12
  let amount;
13
13
  if (amountType == 'total') {
14
- amount = estimatedCost?.totalAmount;
14
+ amount = cost?.totalAmount;
15
15
  }
16
16
  else if (amountType == 'subtotal') {
17
- amount = estimatedCost?.subtotalAmount;
17
+ amount = cost?.subtotalAmount;
18
18
  }
19
19
  else if (amountType == 'tax') {
20
- amount = estimatedCost?.totalTaxAmount;
20
+ amount = cost?.totalTaxAmount;
21
21
  }
22
22
  else if (amountType == 'duty') {
23
- amount = estimatedCost?.totalDutyAmount;
23
+ amount = cost?.totalDutyAmount;
24
24
  }
25
25
  if (amount == null) {
26
26
  return null;
@@ -0,0 +1 @@
1
+ export { CartCost } from './CartCost.client';
@@ -0,0 +1 @@
1
+ export { CartCost } from './CartCost.client';
@@ -9,8 +9,8 @@ export function CartLinePrice(props) {
9
9
  const cartLine = useCartLine();
10
10
  const { priceType = 'regular', ...passthroughProps } = props;
11
11
  const moneyV2 = priceType === 'regular'
12
- ? cartLine.estimatedCost.totalAmount
13
- : cartLine.estimatedCost.compareAtAmount;
12
+ ? cartLine.cost.totalAmount
13
+ : cartLine.cost.compareAtAmountPerQuantity;
14
14
  if (moneyV2 == null) {
15
15
  return null;
16
16
  }
@@ -4,13 +4,13 @@ export declare const CartLineContext: import("react").Context<({
4
4
  attributes: ({
5
5
  __typename?: "Attribute" | undefined;
6
6
  } & Pick<import("../../storefront-api-types").Attribute, "key" | "value">)[];
7
- estimatedCost: {
8
- __typename?: "CartLineEstimatedCost" | undefined;
7
+ cost: {
8
+ __typename?: "CartLineCost" | undefined;
9
9
  } & {
10
10
  totalAmount: {
11
11
  __typename?: "MoneyV2" | undefined;
12
12
  } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">;
13
- compareAtAmount?: import("../../storefront-api-types").Maybe<{
13
+ compareAtAmountPerQuantity?: import("../../storefront-api-types").Maybe<{
14
14
  __typename?: "MoneyV2" | undefined;
15
15
  } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">> | undefined;
16
16
  };
@@ -35,14 +35,21 @@ function cartReducer(state, action) {
35
35
  break;
36
36
  }
37
37
  case 'reject': {
38
+ if (action.errors) {
39
+ console.group('%cCart Error:', 'color:red');
40
+ for (const [i, error] of action.errors.entries()) {
41
+ console.log(`%c${i + 1}. ` + error.message, 'color:red');
42
+ }
43
+ console.groupEnd();
44
+ }
38
45
  if (state.status === 'fetching' || state.status === 'creating') {
39
- return { status: 'uninitialized', error: action.error };
46
+ return { status: 'uninitialized', error: action.errors };
40
47
  }
41
48
  else if (state.status === 'updating') {
42
49
  return {
43
50
  status: 'idle',
44
51
  cart: state.lastValidCart,
45
- error: action.error,
52
+ error: action.errors,
46
53
  };
47
54
  }
48
55
  break;
@@ -151,13 +158,16 @@ function cartReducer(state, action) {
151
158
  * You must use this component if you want to use the `useCart` hook or related hooks, or if you would like to use the `AddToCartButton` component.
152
159
  */
153
160
  export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLineRemove, onLineUpdate, onNoteUpdate, onBuyerIdentityUpdate, onAttributesUpdate, onDiscountCodesUpdate, data: cart, cartFragment = defaultCartFragment, customerAccessToken, countryCode = CountryCode.Us, }) {
161
+ if (countryCode)
162
+ countryCode = countryCode.toUpperCase();
154
163
  const initialStatus = cart
155
164
  ? { status: 'idle', cart: cartFromGraphQL(cart) }
156
165
  : { status: 'uninitialized' };
157
166
  const [state, dispatch] = useReducer((state, dispatch) => cartReducer(state, dispatch), initialStatus);
158
167
  const fetchCart = useCartFetch();
159
168
  const countryChanged = state.status === 'idle' &&
160
- countryCode !== state?.cart?.buyerIdentity?.countryCode;
169
+ countryCode !== state?.cart?.buyerIdentity?.countryCode &&
170
+ !state.error;
161
171
  const cartFetch = useCallback(async (cartId) => {
162
172
  dispatch({ type: 'cartFetch' });
163
173
  const { data } = await fetchCart({
@@ -190,7 +200,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
190
200
  }
191
201
  cart.buyerIdentity.customerAccessToken = customerAccessToken;
192
202
  }
193
- const { data, error } = await fetchCart({
203
+ const { data, errors } = await fetchCart({
194
204
  query: CartCreate(cartFragment),
195
205
  variables: {
196
206
  input: cart,
@@ -198,10 +208,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
198
208
  country: countryCode,
199
209
  },
200
210
  });
201
- if (error) {
211
+ if (errors) {
202
212
  dispatch({
203
213
  type: 'reject',
204
- error,
214
+ errors,
205
215
  });
206
216
  }
207
217
  if (data?.cartCreate?.cart) {
@@ -229,7 +239,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
229
239
  if (state.status === 'idle') {
230
240
  dispatch({ type: 'addLineItem' });
231
241
  onLineAdd?.();
232
- const { data, error } = await fetchCart({
242
+ const { data, errors } = await fetchCart({
233
243
  query: CartLineAdd(cartFragment),
234
244
  variables: {
235
245
  cartId: state.cart.id,
@@ -238,10 +248,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
238
248
  country: countryCode,
239
249
  },
240
250
  });
241
- if (error) {
251
+ if (errors) {
242
252
  dispatch({
243
253
  type: 'reject',
244
- error,
254
+ errors,
245
255
  });
246
256
  }
247
257
  if (data?.cartLinesAdd?.cart) {
@@ -260,7 +270,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
260
270
  if (state.status === 'idle') {
261
271
  dispatch({ type: 'removeLineItem', lines });
262
272
  onLineRemove?.();
263
- const { data, error } = await fetchCart({
273
+ const { data, errors } = await fetchCart({
264
274
  query: CartLineRemove(cartFragment),
265
275
  variables: {
266
276
  cartId: state.cart.id,
@@ -269,10 +279,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
269
279
  country: countryCode,
270
280
  },
271
281
  });
272
- if (error) {
282
+ if (errors) {
273
283
  dispatch({
274
284
  type: 'reject',
275
- error,
285
+ errors,
276
286
  });
277
287
  }
278
288
  if (data?.cartLinesRemove?.cart) {
@@ -291,7 +301,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
291
301
  if (state.status === 'idle') {
292
302
  dispatch({ type: 'updateLineItem', lines });
293
303
  onLineUpdate?.();
294
- const { data, error } = await fetchCart({
304
+ const { data, errors } = await fetchCart({
295
305
  query: CartLineUpdate(cartFragment),
296
306
  variables: {
297
307
  cartId: state.cart.id,
@@ -300,10 +310,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
300
310
  country: countryCode,
301
311
  },
302
312
  });
303
- if (error) {
313
+ if (errors) {
304
314
  dispatch({
305
315
  type: 'reject',
306
- error,
316
+ errors,
307
317
  });
308
318
  }
309
319
  if (data?.cartLinesUpdate?.cart) {
@@ -322,7 +332,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
322
332
  if (state.status === 'idle') {
323
333
  dispatch({ type: 'noteUpdate' });
324
334
  onNoteUpdate?.();
325
- const { data, error } = await fetchCart({
335
+ const { data, errors } = await fetchCart({
326
336
  query: CartNoteUpdate(cartFragment),
327
337
  variables: {
328
338
  cartId: state.cart.id,
@@ -331,10 +341,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
331
341
  country: countryCode,
332
342
  },
333
343
  });
334
- if (error) {
344
+ if (errors) {
335
345
  dispatch({
336
346
  type: 'reject',
337
- error,
347
+ errors,
338
348
  });
339
349
  }
340
350
  if (data?.cartNoteUpdate?.cart) {
@@ -349,7 +359,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
349
359
  if (state.status === 'idle') {
350
360
  dispatch({ type: 'buyerIdentityUpdate' });
351
361
  onBuyerIdentityUpdate?.();
352
- const { data, error } = await fetchCart({
362
+ const { data, errors } = await fetchCart({
353
363
  query: CartBuyerIdentityUpdate(cartFragment),
354
364
  variables: {
355
365
  cartId: state.cart.id,
@@ -358,10 +368,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
358
368
  country: countryCode,
359
369
  },
360
370
  });
361
- if (error) {
371
+ if (errors) {
362
372
  dispatch({
363
373
  type: 'reject',
364
- error,
374
+ errors,
365
375
  });
366
376
  }
367
377
  if (data?.cartBuyerIdentityUpdate?.cart) {
@@ -376,7 +386,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
376
386
  if (state.status === 'idle') {
377
387
  dispatch({ type: 'cartAttributesUpdate' });
378
388
  onAttributesUpdate?.();
379
- const { data, error } = await fetchCart({
389
+ const { data, errors } = await fetchCart({
380
390
  query: CartAttributesUpdate(cartFragment),
381
391
  variables: {
382
392
  cartId: state.cart.id,
@@ -385,10 +395,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
385
395
  country: countryCode,
386
396
  },
387
397
  });
388
- if (error) {
398
+ if (errors) {
389
399
  dispatch({
390
400
  type: 'reject',
391
- error,
401
+ errors,
392
402
  });
393
403
  }
394
404
  if (data?.cartAttributesUpdate?.cart) {
@@ -403,7 +413,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
403
413
  if (state.status === 'idle') {
404
414
  dispatch({ type: 'discountCodesUpdate' });
405
415
  onDiscountCodesUpdate?.();
406
- const { data, error } = await fetchCart({
416
+ const { data, errors } = await fetchCart({
407
417
  query: CartDiscountCodesUpdate(cartFragment),
408
418
  variables: {
409
419
  cartId: state.cart.id,
@@ -412,10 +422,10 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
412
422
  country: countryCode,
413
423
  },
414
424
  });
415
- if (error) {
425
+ if (errors) {
416
426
  dispatch({
417
427
  type: 'reject',
418
- error,
428
+ errors,
419
429
  });
420
430
  }
421
431
  if (data?.cartDiscountCodesUpdate?.cart) {
@@ -7,4 +7,4 @@ export declare const CartBuyerIdentityUpdate: (cartFragment: string) => string;
7
7
  export declare const CartAttributesUpdate: (cartFragment: string) => string;
8
8
  export declare const CartDiscountCodesUpdate: (cartFragment: string) => string;
9
9
  export declare const CartQuery: (cartFragment: string) => string;
10
- export declare const defaultCartFragment = "\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n estimatedCost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
10
+ export declare const defaultCartFragment = "\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
@@ -126,12 +126,12 @@ fragment CartFragment on Cart {
126
126
  key
127
127
  value
128
128
  }
129
- estimatedCost {
129
+ cost {
130
130
  totalAmount {
131
131
  amount
132
132
  currencyCode
133
133
  }
134
- compareAtAmount {
134
+ compareAtAmountPerQuantity {
135
135
  amount
136
136
  currencyCode
137
137
  }
@@ -164,7 +164,7 @@ fragment CartFragment on Cart {
164
164
  }
165
165
  }
166
166
  }
167
- estimatedCost {
167
+ cost {
168
168
  subtotalAmount {
169
169
  ...MoneyFragment
170
170
  }
@@ -37,13 +37,13 @@ export declare type CartAttributesUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
- estimatedCost: {
41
- __typename?: 'CartLineEstimatedCost';
40
+ cost: {
41
+ __typename?: 'CartLineCost';
42
42
  } & {
43
43
  totalAmount: {
44
44
  __typename?: 'MoneyV2';
45
45
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
- compareAtAmount?: Types.Maybe<{
46
+ compareAtAmountPerQuantity?: Types.Maybe<{
47
47
  __typename?: 'MoneyV2';
48
48
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
49
  };
@@ -69,8 +69,8 @@ export declare type CartAttributesUpdateMutation = {
69
69
  };
70
70
  }>;
71
71
  };
72
- estimatedCost: {
73
- __typename?: 'CartEstimatedCost';
72
+ cost: {
73
+ __typename?: 'CartCost';
74
74
  } & {
75
75
  subtotalAmount: {
76
76
  __typename?: 'MoneyV2';
@@ -37,13 +37,13 @@ export declare type CartBuyerIdentityUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
- estimatedCost: {
41
- __typename?: 'CartLineEstimatedCost';
40
+ cost: {
41
+ __typename?: 'CartLineCost';
42
42
  } & {
43
43
  totalAmount: {
44
44
  __typename?: 'MoneyV2';
45
45
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
- compareAtAmount?: Types.Maybe<{
46
+ compareAtAmountPerQuantity?: Types.Maybe<{
47
47
  __typename?: 'MoneyV2';
48
48
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
49
  };
@@ -69,8 +69,8 @@ export declare type CartBuyerIdentityUpdateMutation = {
69
69
  };
70
70
  }>;
71
71
  };
72
- estimatedCost: {
73
- __typename?: 'CartEstimatedCost';
72
+ cost: {
73
+ __typename?: 'CartCost';
74
74
  } & {
75
75
  subtotalAmount: {
76
76
  __typename?: 'MoneyV2';
@@ -36,13 +36,13 @@ export declare type CartCreateMutation = {
36
36
  attributes: Array<{
37
37
  __typename?: 'Attribute';
38
38
  } & Pick<Types.Attribute, 'key' | 'value'>>;
39
- estimatedCost: {
40
- __typename?: 'CartLineEstimatedCost';
39
+ cost: {
40
+ __typename?: 'CartLineCost';
41
41
  } & {
42
42
  totalAmount: {
43
43
  __typename?: 'MoneyV2';
44
44
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
45
- compareAtAmount?: Types.Maybe<{
45
+ compareAtAmountPerQuantity?: Types.Maybe<{
46
46
  __typename?: 'MoneyV2';
47
47
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
48
48
  };
@@ -68,8 +68,8 @@ export declare type CartCreateMutation = {
68
68
  };
69
69
  }>;
70
70
  };
71
- estimatedCost: {
72
- __typename?: 'CartEstimatedCost';
71
+ cost: {
72
+ __typename?: 'CartCost';
73
73
  } & {
74
74
  subtotalAmount: {
75
75
  __typename?: 'MoneyV2';
@@ -37,13 +37,13 @@ export declare type CartDiscountCodesUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
- estimatedCost: {
41
- __typename?: 'CartLineEstimatedCost';
40
+ cost: {
41
+ __typename?: 'CartLineCost';
42
42
  } & {
43
43
  totalAmount: {
44
44
  __typename?: 'MoneyV2';
45
45
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
- compareAtAmount?: Types.Maybe<{
46
+ compareAtAmountPerQuantity?: Types.Maybe<{
47
47
  __typename?: 'MoneyV2';
48
48
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
49
  };
@@ -69,8 +69,8 @@ export declare type CartDiscountCodesUpdateMutation = {
69
69
  };
70
70
  }>;
71
71
  };
72
- estimatedCost: {
73
- __typename?: 'CartEstimatedCost';
72
+ cost: {
73
+ __typename?: 'CartCost';
74
74
  } & {
75
75
  subtotalAmount: {
76
76
  __typename?: 'MoneyV2';
@@ -25,13 +25,13 @@ export declare type CartFragmentFragment = {
25
25
  attributes: Array<{
26
26
  __typename?: 'Attribute';
27
27
  } & Pick<Types.Attribute, 'key' | 'value'>>;
28
- estimatedCost: {
29
- __typename?: 'CartLineEstimatedCost';
28
+ cost: {
29
+ __typename?: 'CartLineCost';
30
30
  } & {
31
31
  totalAmount: {
32
32
  __typename?: 'MoneyV2';
33
33
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
34
- compareAtAmount?: Types.Maybe<{
34
+ compareAtAmountPerQuantity?: Types.Maybe<{
35
35
  __typename?: 'MoneyV2';
36
36
  } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
37
37
  };
@@ -57,8 +57,8 @@ export declare type CartFragmentFragment = {
57
57
  };
58
58
  }>;
59
59
  };
60
- estimatedCost: {
61
- __typename?: 'CartEstimatedCost';
60
+ cost: {
61
+ __typename?: 'CartCost';
62
62
  } & {
63
63
  subtotalAmount: {
64
64
  __typename?: 'MoneyV2';