@graphcommerce/magento-cart 10.0.1-canary.0 → 10.0.1-canary.1

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,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.1-canary.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2571](https://github.com/graphcommerce-org/graphcommerce/pull/2571) [`78a2a8a`](https://github.com/graphcommerce-org/graphcommerce/commit/78a2a8a919346e1f9bccddf7e52682f4adb9a4e0) - Solve issue where the @client fields could not be resolved correctly. ([@paales](https://github.com/paales))
8
+
3
9
  ## 10.0.1-canary.0
4
10
 
5
11
  ### Patch Changes
@@ -3,9 +3,9 @@ import type {
3
3
  TypedDocumentNode,
4
4
  WatchQueryFetchPolicy,
5
5
  } from '@graphcommerce/graphql'
6
- import { useQuery } from '@graphcommerce/graphql'
7
- import { CombinedGraphQLErrors } from '@apollo/client/errors'
6
+ import { CombinedGraphQLErrors, useQuery } from '@graphcommerce/graphql'
8
7
  import type { useQuery as useQueryType } from '@apollo/client/react'
8
+ import { t } from '@lingui/core/macro'
9
9
  import { GraphQLError } from 'graphql'
10
10
  import { useRouter } from 'next/router'
11
11
  import { useCartShouldLoginToContinue } from './useCartPermissions'
@@ -61,7 +61,7 @@ export function useCartQuery<
61
61
  ...query,
62
62
  error: new CombinedGraphQLErrors({
63
63
  errors: [
64
- new GraphQLError('Action can not be performed by the current user', {
64
+ new GraphQLError(t`You must be logged in to view your cart.`, {
65
65
  extensions: { category: 'graphql-authorization' },
66
66
  }),
67
67
  ],
@@ -1,14 +1,11 @@
1
- import {
2
- CombinedGraphQLErrors,
3
- TypedDocumentNode,
4
- useApolloClient,
5
- useMutation,
6
- } from '@graphcommerce/graphql'
1
+ import type { TypedDocumentNode, useMutation } from '@graphcommerce/graphql'
2
+ import { CombinedGraphQLErrors, useApolloClient } from '@graphcommerce/graphql'
7
3
  import type {
8
4
  UseFormGqlMutationReturn,
9
5
  UseFormGraphQlOptions,
10
6
  } from '@graphcommerce/react-hook-form'
11
7
  import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
8
+ import { t } from '@lingui/core/macro'
12
9
  import { GraphQLError, Kind } from 'graphql'
13
10
  import { useCartIdContext } from '../components/CartIdContext'
14
11
  import { isProtectedCartOperation } from '../link/isProtectedCartOperation'
@@ -69,7 +66,7 @@ export function useFormGqlMutationCart<
69
66
  ...result,
70
67
  error: new CombinedGraphQLErrors({
71
68
  errors: [
72
- new GraphQLError('Action can not be performed by the current user', {
69
+ new GraphQLError(t`You must be logged in to modify your cart.`, {
73
70
  extensions: { category: 'graphql-authorization' },
74
71
  }),
75
72
  ],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.1-canary.0",
5
+ "version": "10.0.1-canary.1",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -20,20 +20,20 @@
20
20
  "./plugins/useSignInFormMergeCart": "./plugins/useSignInFormMergeCart.ts"
21
21
  },
22
22
  "peerDependencies": {
23
- "@graphcommerce/ecommerce-ui": "^10.0.1-canary.0",
24
- "@graphcommerce/eslint-config-pwa": "^10.0.1-canary.0",
25
- "@graphcommerce/framer-next-pages": "^10.0.1-canary.0",
26
- "@graphcommerce/framer-scroller": "^10.0.1-canary.0",
27
- "@graphcommerce/framer-utils": "^10.0.1-canary.0",
28
- "@graphcommerce/graphql": "^10.0.1-canary.0",
29
- "@graphcommerce/image": "^10.0.1-canary.0",
30
- "@graphcommerce/magento-customer": "^10.0.1-canary.0",
31
- "@graphcommerce/magento-graphql": "^10.0.1-canary.0",
32
- "@graphcommerce/magento-store": "^10.0.1-canary.0",
33
- "@graphcommerce/next-ui": "^10.0.1-canary.0",
34
- "@graphcommerce/prettier-config-pwa": "^10.0.1-canary.0",
35
- "@graphcommerce/react-hook-form": "^10.0.1-canary.0",
36
- "@graphcommerce/typescript-config-pwa": "^10.0.1-canary.0",
23
+ "@graphcommerce/ecommerce-ui": "^10.0.1-canary.1",
24
+ "@graphcommerce/eslint-config-pwa": "^10.0.1-canary.1",
25
+ "@graphcommerce/framer-next-pages": "^10.0.1-canary.1",
26
+ "@graphcommerce/framer-scroller": "^10.0.1-canary.1",
27
+ "@graphcommerce/framer-utils": "^10.0.1-canary.1",
28
+ "@graphcommerce/graphql": "^10.0.1-canary.1",
29
+ "@graphcommerce/image": "^10.0.1-canary.1",
30
+ "@graphcommerce/magento-customer": "^10.0.1-canary.1",
31
+ "@graphcommerce/magento-graphql": "^10.0.1-canary.1",
32
+ "@graphcommerce/magento-store": "^10.0.1-canary.1",
33
+ "@graphcommerce/next-ui": "^10.0.1-canary.1",
34
+ "@graphcommerce/prettier-config-pwa": "^10.0.1-canary.1",
35
+ "@graphcommerce/react-hook-form": "^10.0.1-canary.1",
36
+ "@graphcommerce/typescript-config-pwa": "^10.0.1-canary.1",
37
37
  "@lingui/core": "^5",
38
38
  "@lingui/macro": "^5",
39
39
  "@lingui/react": "^5",
package/typePolicies.ts CHANGED
@@ -35,6 +35,8 @@ export const cartTypePolicies: StrictTypedTypePolicies = {
35
35
  fields: {
36
36
  cart: (_, { args, toReference }) =>
37
37
  toReference({ __typename: 'Cart', id: (args as QuerycartArgs)?.cart_id }),
38
+ // https://github.com/apollographql/apollo-client/issues/12930
39
+ currentCartId: { merge: (existing, incoming) => incoming ?? existing },
38
40
  },
39
41
  },
40
42
  Mutation: {