@graphcommerce/magento-wishlist 9.1.0-canary.40 → 9.1.0-canary.42

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @graphcommerce/magento-wishlist
2
2
 
3
+ ## 9.1.0-canary.42
4
+
5
+ ## 9.1.0-canary.41
6
+
7
+ ### Patch Changes
8
+
9
+ - [#2530](https://github.com/graphcommerce-org/graphcommerce/pull/2530) [`c38c27f`](https://github.com/graphcommerce-org/graphcommerce/commit/c38c27fee77f5ba10db435b2e1532a7527e8155c) - Solve compat issue with adobe commerce ([@paales](https://github.com/paales))
10
+
3
11
  ## 9.1.0-canary.40
4
12
 
5
13
  ### Patch Changes
@@ -119,7 +119,7 @@ export function useAddProductToWishlistAction(
119
119
  : product.uid,
120
120
  configurable_options: allOptionsSelected ? configurableOptions : [],
121
121
  product,
122
- },
122
+ } as WishlistItemFragment,
123
123
  ]).then(() => setShowSuccess(true))
124
124
  }
125
125
  }
@@ -4,7 +4,7 @@ import {
4
4
  useCustomerSession,
5
5
  useGuestQuery,
6
6
  } from '@graphcommerce/magento-customer'
7
- import { filterNonNullableKeys } from '@graphcommerce/next-ui'
7
+ import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
8
8
  import type { WishlistItemFragment } from '../../queries/WishlistItem.gql'
9
9
  import { useWishlistEnabled } from '../useWishlistEnabled/useWishlistEnabled'
10
10
  import type {
@@ -39,19 +39,18 @@ export function useWishlistItems(): UseWishlistItemsReturn {
39
39
  const wishlistGuest = useGuestQuery(UseWishlistGuestDocument, { skip: !enabled })
40
40
 
41
41
  if (loggedIn) {
42
- const items = filterNonNullableKeys(
42
+ const items = (
43
43
  (wishlistCustomer.data ?? wishlistCustomer.previousData)?.customer?.wishlists?.[0]?.items_v2
44
- ?.items,
45
- ['product'],
46
- )
44
+ ?.items ?? []
45
+ ).filter(nonNullable)
47
46
 
48
47
  return { ...wishlistCustomer, enabled, loggedIn: true, items }
49
48
  }
50
49
 
51
- const items = filterNonNullableKeys(
52
- (wishlistGuest.data ?? wishlistGuest.previousData)?.customer?.wishlists?.[0]?.items_v2?.items,
53
- ['product'],
54
- )
50
+ const items = (
51
+ (wishlistGuest.data ?? wishlistGuest.previousData)?.customer?.wishlists?.[0]?.items_v2?.items ??
52
+ []
53
+ ).filter(nonNullable)
55
54
 
56
55
  return { ...wishlistGuest, enabled, loggedIn: false, items }
57
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-wishlist",
3
- "version": "9.1.0-canary.40",
3
+ "version": "9.1.0-canary.42",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -13,20 +13,20 @@
13
13
  }
14
14
  },
15
15
  "peerDependencies": {
16
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.40",
17
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.40",
18
- "@graphcommerce/graphql": "^9.1.0-canary.40",
19
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.40",
20
- "@graphcommerce/image": "^9.1.0-canary.40",
21
- "@graphcommerce/magento-cart": "^9.1.0-canary.40",
22
- "@graphcommerce/magento-customer": "^9.1.0-canary.40",
23
- "@graphcommerce/magento-product": "^9.1.0-canary.40",
24
- "@graphcommerce/magento-product-configurable": "^9.1.0-canary.40",
25
- "@graphcommerce/magento-store": "^9.1.0-canary.40",
26
- "@graphcommerce/next-config": "^9.1.0-canary.40",
27
- "@graphcommerce/next-ui": "^9.1.0-canary.40",
28
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.40",
29
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.40",
16
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.42",
17
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.42",
18
+ "@graphcommerce/graphql": "^9.1.0-canary.42",
19
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.42",
20
+ "@graphcommerce/image": "^9.1.0-canary.42",
21
+ "@graphcommerce/magento-cart": "^9.1.0-canary.42",
22
+ "@graphcommerce/magento-customer": "^9.1.0-canary.42",
23
+ "@graphcommerce/magento-product": "^9.1.0-canary.42",
24
+ "@graphcommerce/magento-product-configurable": "^9.1.0-canary.42",
25
+ "@graphcommerce/magento-store": "^9.1.0-canary.42",
26
+ "@graphcommerce/next-config": "^9.1.0-canary.42",
27
+ "@graphcommerce/next-ui": "^9.1.0-canary.42",
28
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.42",
29
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.42",
30
30
  "@lingui/core": "^4.2.1",
31
31
  "@lingui/macro": "^4.2.1",
32
32
  "@lingui/react": "^4.2.1",