Skip to content

Commit

Permalink
feat(UDM-1217): UDM enhancements 6 (#1500)
Browse files Browse the repository at this point in the history
* feat: align cart requests response

* chore: changeset

* chore: fix unit-test config
  • Loading branch information
Razz21 authored Feb 15, 2024
1 parent 892253d commit f0d4ad7
Show file tree
Hide file tree
Showing 19 changed files with 1,412 additions and 264 deletions.
21 changes: 21 additions & 0 deletions .changeset/shaggy-houses-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
"@vue-storefront/magento-api": patch
"@vue-storefront/magento-types": patch
---

**[CHANGED]** Enhanced default GQL queries with new fields

- [`SetGuestEmailOnCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/SetBillingAddressOnCartMutation)
- [`SetBillingAddressOnCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/SetBillingAddressOnCartMutation)
- [`SetPaymentMethodOnCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/SetPaymentMethodOnCartMutation)
- [`SetShippingAddressesOnCartMutation`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/SetShippingAddressesOnCartMutation)

with new fields:

- `prices`
- `subtotal_with_discount_excluding_tax`
- `configured_variant`
- `sku`
- `name`
- `only_x_left_in_stock`
- `price_range`
4 changes: 2 additions & 2 deletions packages/api-client/__tests__/mockData/api/storeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const STORE_CONFIG_MOCK_RESP = {
configurable_thumbnail_source: "parent",
copyright: "Copyright © 2013-present Magento, Inc. All rights reserved.",
default_description: null,
default_display_currency_code: "USD",
default_display_currency_code: "EUR",
default_keywords: null,
default_title: "Magento Commerce",
grid_per_page: 12,
Expand All @@ -24,7 +24,7 @@ const STORE_CONFIG_MOCK_RESP = {
list_mode: "grid-list",
list_per_page: 10,
list_per_page_values: "5,10,15,20,25",
locale: "en_US",
locale: "en_EN",
logo_alt: null,
logo_height: null,
logo_width: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,201 @@ export default `
mutation setBillingAddressOnCart($input: SetBillingAddressOnCartInput) {
setBillingAddressOnCart(input: $input) {
cart {
billing_address {
id
email
is_virtual
applied_coupons {
code
}
prices {
subtotal_with_discount_excluding_tax {
value
currency
}
subtotal_excluding_tax {
value
currency
}
subtotal_including_tax {
value
currency
}
applied_taxes {
amount {
value
currency
}
label
}
discounts {
amount {
value
currency
}
label
}
grand_total {
value
currency
}
}
items {
uid
product {
uid
__typename
sku
name
stock_status
only_x_left_in_stock
rating_summary
thumbnail {
url
position
disabled
label
}
url_key
url_rewrites {
url
}
price_range {
maximum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
categories {
uid
name
url_suffix
url_path
url_key
include_in_menu
breadcrumbs {
category_name
category_url_path
}
}
review_count
reviews {
items {
average_rating
ratings_breakdown {
name
value
}
}
}
}
prices {
row_total {
value
currency
}
row_total_including_tax {
value
currency
}
total_item_discount {
value
currency
}
}
quantity
... on ConfigurableCartItem {
configurable_options {
configurable_product_option_uid
option_label
configurable_product_option_value_uid
value_label
}
configured_variant {
sku
name
only_x_left_in_stock
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
thumbnail {
url
}
}
}
... on BundleCartItem {
bundle_options {
uid
label
type
values {
id
label
price
quantity
}
}
}
}
total_quantity
shipping_addresses {
firstname
lastname
street
city
company
region {
code
region_id
label
}
postcode
telephone
country {
code
label
}
selected_shipping_method {
carrier_code
carrier_title
method_code
method_title
amount {
value
currency
}
}
}
billing_address {
firstname
lastname
street
city
company
region {
code
region_id
Expand Down
Loading

0 comments on commit f0d4ad7

Please sign in to comment.