@graphcommerce/magento-customer 4.5.1 → 4.5.4

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,45 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1517](https://github.com/graphcommerce-org/graphcommerce/pull/1517) [`c877e438a`](https://github.com/graphcommerce-org/graphcommerce/commit/c877e438a48f30204fa3e36b611906a546e1cf5c) Thanks [@NickdeK](https://github.com/NickdeK)! - Fixed graphql error display
8
+
9
+ - Updated dependencies [[`371e6cf52`](https://github.com/graphcommerce-org/graphcommerce/commit/371e6cf52916a3b6c44192bd40cc8271bd608832), [`4143483f3`](https://github.com/graphcommerce-org/graphcommerce/commit/4143483f37c038d2bbf218be2685e27a31a35745)]:
10
+ - @graphcommerce/next-ui@4.10.0
11
+ - @graphcommerce/ecommerce-ui@1.0.20
12
+ - @graphcommerce/magento-store@4.2.11
13
+
14
+ ## 4.5.3
15
+
16
+ ### Patch Changes
17
+
18
+ - [#1511](https://github.com/graphcommerce-org/graphcommerce/pull/1511) [`8a626ecf7`](https://github.com/graphcommerce-org/graphcommerce/commit/8a626ecf7ed00c46a28088e0b9bae00a4e1ae019) Thanks [@paales](https://github.com/paales)! - make sure useCustomerQuery only runs when the user is actually logged instead of only a token
19
+
20
+ * [#1490](https://github.com/graphcommerce-org/graphcommerce/pull/1490) [`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb) Thanks [@paales](https://github.com/paales)! - upgraded packages
21
+
22
+ * Updated dependencies [[`a9213f1f5`](https://github.com/graphcommerce-org/graphcommerce/commit/a9213f1f5a410d217768386ccb6d9b5ce7bd5782), [`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb)]:
23
+ - @graphcommerce/next-ui@4.9.0
24
+ - @graphcommerce/ecommerce-ui@1.0.19
25
+ - @graphcommerce/graphql@3.2.1
26
+ - @graphcommerce/graphql-mesh@4.1.4
27
+ - @graphcommerce/image@3.1.7
28
+ - @graphcommerce/magento-graphql@3.0.14
29
+ - @graphcommerce/magento-store@4.2.10
30
+ - @graphcommerce/react-hook-form@3.2.2
31
+
32
+ ## 4.5.2
33
+
34
+ ### Patch Changes
35
+
36
+ - [#1509](https://github.com/graphcommerce-org/graphcommerce/pull/1509) [`711fa6e04`](https://github.com/graphcommerce-org/graphcommerce/commit/711fa6e04519bbe91825fec7e1714277c1a8fa68) Thanks [@paales](https://github.com/paales)! - onAuthenticationError fix thrown exception on error handling
37
+
38
+ - Updated dependencies [[`0ab7c5465`](https://github.com/graphcommerce-org/graphcommerce/commit/0ab7c5465441cba9bf8cd185a6790ce2f443f4ed)]:
39
+ - @graphcommerce/next-ui@4.8.4
40
+ - @graphcommerce/ecommerce-ui@1.0.18
41
+ - @graphcommerce/magento-store@4.2.9
42
+
3
43
  ## 4.5.1
4
44
 
5
45
  ### Patch Changes
@@ -16,14 +16,14 @@ export type ApolloCustomerErrorFullPageProps = {
16
16
 
17
17
  export function ApolloCustomerErrorFullPage(props: ApolloCustomerErrorFullPageProps) {
18
18
  const { error, icon, altButton, button, ...alertProps } = props
19
- const [, unauthorized] = useAuthorizationErrorMasked()
19
+ const [newError, unauthorized] = useAuthorizationErrorMasked()
20
20
  const { token } = useCustomerSession()
21
21
 
22
22
  return (
23
23
  <ApolloErrorFullPage
24
24
  icon={<IconSvg src={iconPerson} size='xxl' />}
25
25
  {...props}
26
- error={error}
26
+ error={newError}
27
27
  button={
28
28
  unauthorized ? (
29
29
  <PageLink href='/account/signin' passHref>
@@ -1,6 +1,6 @@
1
1
  import { ApolloErrorSnackbar, ApolloErrorSnackbarProps } from '@graphcommerce/ecommerce-ui'
2
2
  import { Trans } from '@lingui/react'
3
- import { Button, Link } from '@mui/material'
3
+ import { Button } from '@mui/material'
4
4
  import NextLink from 'next/link'
5
5
  import { useCustomerSession } from '../../hooks/useCustomerSession'
6
6
  import { useAuthorizationErrorMasked } from './useAuthorizationErrorMasked'
@@ -15,6 +15,7 @@ export function ApolloCustomerErrorSnackbar(props: ApolloCustomerErrorSnackbarPr
15
15
  return (
16
16
  <ApolloErrorSnackbar
17
17
  {...props}
18
+ error={newError}
18
19
  action={
19
20
  unauthorized ? (
20
21
  <NextLink href='/account/signin' passHref>
@@ -12,5 +12,6 @@ export function useAuthorizationErrorMasked(error?: ApolloError) {
12
12
  mask: token
13
13
  ? i18n._(/* i18n */ `Please reauthenticate and try again`)
14
14
  : i18n._(/* i18n */ `You must sign in to continue`),
15
+ extract: false,
15
16
  })
16
17
  }
@@ -6,6 +6,6 @@ export function useCustomerQuery<Q, V>(
6
6
  document: TypedDocumentNode<Q, V>,
7
7
  queryOptions: QueryHookOptions<Q, V> = {},
8
8
  ) {
9
- const { token } = useCustomerSession()
10
- return useQuery(document, { ...queryOptions, ssr: false, skip: !token })
9
+ const { loggedIn } = useCustomerSession()
10
+ return useQuery(document, { ...queryOptions, ssr: false, skip: !loggedIn })
11
11
  }
@@ -26,9 +26,10 @@ export const onAuthenticationError = onError(({ graphQLErrors, operation }) => {
26
26
  const { cache } = operation.getContext()
27
27
  if (graphQLErrors) {
28
28
  for (const err of graphQLErrors) {
29
- if (err.extensions.category === 'graphql-authorization') {
29
+ if (err.extensions?.category === 'graphql-authorization') {
30
30
  // Modify the operation context with a new token
31
31
  invalidateToken(cache as InMemoryCache)
32
+ break;
32
33
  }
33
34
  }
34
35
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-customer",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.5.1",
5
+ "version": "4.5.4",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,29 +12,29 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.7",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.8",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.3",
18
18
  "@playwright/test": "^1.21.1",
19
19
  "type-fest": "^2.12.2"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/ecommerce-ui": "1.0.17",
23
- "@graphcommerce/graphql": "3.2.0",
24
- "@graphcommerce/graphql-mesh": "4.1.3",
25
- "@graphcommerce/image": "3.1.6",
26
- "@graphcommerce/magento-graphql": "3.0.13",
27
- "@graphcommerce/magento-store": "4.2.8",
28
- "@graphcommerce/next-ui": "4.8.3",
29
- "@graphcommerce/react-hook-form": "3.2.1"
22
+ "@graphcommerce/ecommerce-ui": "1.0.20",
23
+ "@graphcommerce/graphql": "3.2.1",
24
+ "@graphcommerce/graphql-mesh": "4.1.4",
25
+ "@graphcommerce/image": "3.1.7",
26
+ "@graphcommerce/magento-graphql": "3.0.14",
27
+ "@graphcommerce/magento-store": "4.2.11",
28
+ "@graphcommerce/next-ui": "4.10.0",
29
+ "@graphcommerce/react-hook-form": "3.2.2"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@lingui/react": "^3.13.2",
33
33
  "@lingui/core": "^3.13.2",
34
34
  "@mui/material": "5.5.3",
35
35
  "framer-motion": "^6.2.4",
36
- "next": "12.1.2",
37
- "react": "^17.0.2",
38
- "react-dom": "^17.0.2"
36
+ "next": "^12.1.2",
37
+ "react": "^18.0.0",
38
+ "react-dom": "^18.0.0"
39
39
  }
40
40
  }