@graphcommerce/magento-customer 4.10.2 → 4.10.3
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,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.10.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`396b5de5d`](https://github.com/graphcommerce-org/graphcommerce/commit/396b5de5d50c7b8f59bf636807e7a4b50f14e0b2)]:
|
|
8
|
+
- @graphcommerce/graphql@3.4.8
|
|
9
|
+
- @graphcommerce/magento-graphql@3.1.8
|
|
10
|
+
- @graphcommerce/ecommerce-ui@1.2.2
|
|
11
|
+
- @graphcommerce/magento-store@4.2.31
|
|
12
|
+
|
|
3
13
|
## 4.10.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -13,7 +13,6 @@ import { phonePattern, useFormGqlMutation } from '@graphcommerce/react-hook-form
|
|
|
13
13
|
import { i18n } from '@lingui/core'
|
|
14
14
|
import { Trans } from '@lingui/react'
|
|
15
15
|
import { SxProps, TextField, Theme } from '@mui/material'
|
|
16
|
-
import { useRouter } from 'next/router'
|
|
17
16
|
import { AccountAddressFragment } from '../AccountAddress/AccountAddress.gql'
|
|
18
17
|
import { AddressFields } from '../AddressFields/AddressFields'
|
|
19
18
|
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerErrorAlert'
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useQuery,
|
|
3
|
-
TypedDocumentNode,
|
|
4
|
-
QueryHookOptions,
|
|
5
|
-
QueryResult,
|
|
6
|
-
ApolloError,
|
|
7
|
-
} from '@graphcommerce/graphql'
|
|
8
|
-
import { GraphQLError } from 'graphql'
|
|
1
|
+
import { useQuery, TypedDocumentNode, QueryHookOptions, QueryResult } from '@graphcommerce/graphql'
|
|
9
2
|
import { useCustomerSession } from './useCustomerSession'
|
|
10
3
|
|
|
11
|
-
const notLoggedInError = new ApolloError({
|
|
12
|
-
graphQLErrors: [
|
|
13
|
-
new GraphQLError('Not authorized', {
|
|
14
|
-
extensions: { category: 'graphql-authorization' },
|
|
15
|
-
}),
|
|
16
|
-
],
|
|
17
|
-
})
|
|
18
|
-
|
|
19
4
|
/** Will only execute when the customer is signed in. */
|
|
20
5
|
export function useCustomerQuery<Q, V>(
|
|
21
6
|
document: TypedDocumentNode<Q, V>,
|
|
22
7
|
options: QueryHookOptions<Q, V> & { hydration?: boolean } = {},
|
|
23
8
|
): QueryResult<Q, V> {
|
|
24
9
|
const { hydration, ...queryOptions } = options
|
|
25
|
-
const { loggedIn
|
|
10
|
+
const { loggedIn } = useCustomerSession({ hydration })
|
|
26
11
|
|
|
27
12
|
const result = useQuery(document, {
|
|
28
13
|
...queryOptions,
|
|
@@ -30,8 +15,5 @@ export function useCustomerQuery<Q, V>(
|
|
|
30
15
|
skip: !loggedIn,
|
|
31
16
|
})
|
|
32
17
|
|
|
33
|
-
return
|
|
34
|
-
...result,
|
|
35
|
-
error: query.called && !loggedIn ? notLoggedInError : result.error,
|
|
36
|
-
}
|
|
18
|
+
return result
|
|
37
19
|
}
|
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.10.
|
|
5
|
+
"version": "4.10.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/ecommerce-ui": "1.2.
|
|
22
|
+
"@graphcommerce/ecommerce-ui": "1.2.2",
|
|
23
23
|
"@graphcommerce/framer-utils": "3.2.0",
|
|
24
|
-
"@graphcommerce/graphql": "3.4.
|
|
24
|
+
"@graphcommerce/graphql": "3.4.8",
|
|
25
25
|
"@graphcommerce/graphql-mesh": "4.1.9",
|
|
26
26
|
"@graphcommerce/image": "3.1.9",
|
|
27
|
-
"@graphcommerce/magento-graphql": "3.1.
|
|
28
|
-
"@graphcommerce/magento-store": "4.2.
|
|
27
|
+
"@graphcommerce/magento-graphql": "3.1.8",
|
|
28
|
+
"@graphcommerce/magento-store": "4.2.31",
|
|
29
29
|
"@graphcommerce/next-ui": "4.23.0",
|
|
30
30
|
"@graphcommerce/react-hook-form": "3.3.2"
|
|
31
31
|
},
|