@graphcommerce/magento-graphql 3.0.15 → 3.1.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.
- package/CHANGELOG.md +11 -0
- package/graphqlErrorByCategory.ts +16 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1544](https://github.com/graphcommerce-org/graphcommerce/pull/1544) [`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b) Thanks [@mikekeehnen](https://github.com/mikekeehnen)! - Fixed hydration errors on account, cart and wishlist
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b)]:
|
|
12
|
+
- @graphcommerce/graphql@3.4.0
|
|
13
|
+
|
|
3
14
|
## 3.0.15
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -12,22 +12,30 @@ export type ErrorCategory =
|
|
|
12
12
|
export type GraphQLErrorByCategoryProps = {
|
|
13
13
|
category: ErrorCategory
|
|
14
14
|
error?: ApolloError
|
|
15
|
-
extract?:
|
|
15
|
+
extract?: true
|
|
16
16
|
mask?: string
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export type GraphQLErrorByCategoryPropsNoExtract = Omit<GraphQLErrorByCategoryProps, 'extract'> & {
|
|
20
|
+
extract?: false
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
/**
|
|
20
|
-
* Extract Magento specific
|
|
24
|
+
* Extract Magento specific errors from the error object.
|
|
21
25
|
*
|
|
22
26
|
* It recognizes the errors specified here:
|
|
23
27
|
* https://devdocs.magento.com/guides/v2.4/graphql/develop/exceptions.html
|
|
24
28
|
*/
|
|
25
|
-
export function graphqlErrorByCategory(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
export function graphqlErrorByCategory(
|
|
30
|
+
props: GraphQLErrorByCategoryPropsNoExtract,
|
|
31
|
+
): [ApolloError, GraphQLError | undefined]
|
|
32
|
+
export function graphqlErrorByCategory(
|
|
33
|
+
props: GraphQLErrorByCategoryProps,
|
|
34
|
+
): [ApolloError | undefined, GraphQLError | undefined]
|
|
35
|
+
export function graphqlErrorByCategory(
|
|
36
|
+
props: GraphQLErrorByCategoryProps | GraphQLErrorByCategoryPropsNoExtract,
|
|
37
|
+
): [ApolloError | undefined, GraphQLError | undefined] {
|
|
38
|
+
const { category, error, extract = true, mask } = props
|
|
31
39
|
if (!error) return [error, undefined]
|
|
32
40
|
|
|
33
41
|
const newError = new ApolloError({
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-graphql",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "3.0
|
|
5
|
+
"version": "3.1.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@playwright/test": "^1.21.1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/graphql": "3.
|
|
22
|
+
"@graphcommerce/graphql": "3.4.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"next": "^12.1.2",
|