@graphcommerce/magento-graphql 3.0.13 → 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 CHANGED
@@ -1,5 +1,32 @@
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
+
14
+ ## 3.0.15
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`735b78672`](https://github.com/graphcommerce-org/graphcommerce/commit/735b786724d5401cbe6e88f2515e121a1a0945b2)]:
19
+ - @graphcommerce/graphql@3.3.0
20
+
21
+ ## 3.0.14
22
+
23
+ ### Patch Changes
24
+
25
+ - [#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
26
+
27
+ - Updated dependencies [[`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb)]:
28
+ - @graphcommerce/graphql@3.2.1
29
+
3
30
  ## 3.0.13
4
31
 
5
32
  ### Patch Changes
@@ -12,22 +12,30 @@ export type ErrorCategory =
12
12
  export type GraphQLErrorByCategoryProps = {
13
13
  category: ErrorCategory
14
14
  error?: ApolloError
15
- extract?: boolean
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 erros from the error object.
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
- category,
27
- error,
28
- extract = true,
29
- mask,
30
- }: GraphQLErrorByCategoryProps): [ApolloError | undefined, GraphQLError | undefined] {
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.13",
5
+ "version": "3.1.0",
6
6
  "sideEffects": false,
7
7
  "main": "index.ts",
8
8
  "prettier": "@graphcommerce/prettier-config-pwa",
@@ -13,17 +13,17 @@
13
13
  }
14
14
  },
15
15
  "devDependencies": {
16
- "@graphcommerce/eslint-config-pwa": "^4.1.7",
16
+ "@graphcommerce/eslint-config-pwa": "^4.1.8",
17
17
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
18
18
  "@graphcommerce/typescript-config-pwa": "^4.0.3",
19
19
  "@playwright/test": "^1.21.1"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/graphql": "3.2.0"
22
+ "@graphcommerce/graphql": "3.4.0"
23
23
  },
24
24
  "peerDependencies": {
25
- "next": "12.1.2",
26
- "react": "^17.0.2",
27
- "react-dom": "^17.0.2"
25
+ "next": "^12.1.2",
26
+ "react": "^18.0.0",
27
+ "react-dom": "^18.0.0"
28
28
  }
29
29
  }