@graphcommerce/magento-store 10.0.0-canary.67 → 10.0.0-canary.72

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,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.72
4
+
5
+ ## 10.0.0-canary.71
6
+
7
+ ## 10.0.0-canary.70
8
+
9
+ ### Major Changes
10
+
11
+ - [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
12
+
13
+ ## 10.0.0-canary.69
14
+
15
+ ## 10.0.0-canary.68
16
+
3
17
  ## 10.0.0-canary.67
4
18
 
5
19
  ## 10.0.0-canary.66
@@ -1,10 +1,7 @@
1
- import type { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql'
1
+ import type { ApolloClient } from '@graphcommerce/graphql'
2
2
  import { AttributesFormDocument } from '../../graphql'
3
3
  import type { CustomAttributeFormCode } from './useAttributesForm'
4
4
 
5
- export function preloadAttributesForm(
6
- client: ApolloClient<NormalizedCacheObject>,
7
- formCode: CustomAttributeFormCode,
8
- ) {
5
+ export function preloadAttributesForm(client: ApolloClient, formCode: CustomAttributeFormCode) {
9
6
  return client.query({ query: AttributesFormDocument, variables: { formCode } })
10
7
  }
@@ -23,7 +23,6 @@ export function PriceModifierListChildItem(props: PriceModifierListChildItemProp
23
23
  <Box className={classes.label} sx={{ color }}>
24
24
  {label}
25
25
  </Box>
26
-
27
26
  {(quantity > 1 || secondary) && (
28
27
  <Box className={classes.quantity} sx={{ color: 'text.secondary', whiteSpace: 'nowrap' }}>
29
28
  {quantity > 1 && (
@@ -34,7 +33,6 @@ export function PriceModifierListChildItem(props: PriceModifierListChildItemProp
34
33
  {secondary}
35
34
  </Box>
36
35
  )}
37
-
38
36
  {amount !== 0 && amount && (
39
37
  <Box
40
38
  className={classes.amount}
@@ -52,7 +52,7 @@ export function StoreSwitcherList(props: StoreSwitcherListProps) {
52
52
  color='inherit'
53
53
  className={classes.listItem}
54
54
  sx={(theme) => ({
55
- borderTop: `1px solid ${theme.palette.divider}`,
55
+ borderTop: `1px solid ${theme.vars.palette.divider}`,
56
56
  cursor: 'pointer',
57
57
  })}
58
58
  >
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-store",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.67",
5
+ "version": "10.0.0-canary.72",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -19,19 +19,19 @@
19
19
  "./mesh/resolvers.ts": "./mesh/resolvers.ts"
20
20
  },
21
21
  "peerDependencies": {
22
- "@graphcommerce/ecommerce-ui": "^10.0.0-canary.67",
23
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.67",
24
- "@graphcommerce/framer-utils": "^10.0.0-canary.67",
25
- "@graphcommerce/graphql": "^10.0.0-canary.67",
26
- "@graphcommerce/graphql-mesh": "^10.0.0-canary.67",
27
- "@graphcommerce/image": "^10.0.0-canary.67",
28
- "@graphcommerce/next-ui": "^10.0.0-canary.67",
29
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.67",
30
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.67",
22
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.72",
23
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.72",
24
+ "@graphcommerce/framer-utils": "^10.0.0-canary.72",
25
+ "@graphcommerce/graphql": "^10.0.0-canary.72",
26
+ "@graphcommerce/graphql-mesh": "^10.0.0-canary.72",
27
+ "@graphcommerce/image": "^10.0.0-canary.72",
28
+ "@graphcommerce/next-ui": "^10.0.0-canary.72",
29
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
30
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
31
31
  "@lingui/core": "^5",
32
32
  "@lingui/macro": "^5",
33
33
  "@lingui/react": "^5",
34
- "@mui/material": "^5.10.16",
34
+ "@mui/material": "^7.0.0",
35
35
  "next": "*",
36
36
  "react": "^19.2.0",
37
37
  "react-dom": "^19.2.0"
@@ -1,4 +1,4 @@
1
- import { setContext, type graphqlConfig as graphqlConfigType } from '@graphcommerce/graphql'
1
+ import { SetContextLink, type graphqlConfig as graphqlConfigType } from '@graphcommerce/graphql'
2
2
  import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
  import { cookie } from '@graphcommerce/next-ui'
4
4
 
@@ -14,22 +14,22 @@ export const graphqlConfig: FunctionPlugin<typeof graphqlConfigType> = (prev, co
14
14
  ...results,
15
15
  links: [
16
16
  ...results.links,
17
- setContext((_, context) => {
18
- if (!context.headers) context.headers = {}
19
- if (!context.headers.store) {
20
- context.headers.store = conf.storefront.magentoStoreCode
17
+ new SetContextLink((prevContext) => {
18
+ const headers: Record<string, string> = { ...prevContext.headers }
19
+
20
+ if (!headers.store) {
21
+ headers.store = conf.storefront.magentoStoreCode
21
22
  }
22
23
 
23
24
  const contentCurrency = cookie('Magento-Content-Currency')
24
- if (contentCurrency && typeof context.headers['content-currency'] === 'undefined')
25
- context.headers['content-currency'] = contentCurrency
25
+ if (contentCurrency && typeof headers['content-currency'] === 'undefined')
26
+ headers['content-currency'] = contentCurrency
26
27
 
27
28
  if (conf.preview) {
28
29
  // To disable caching from the backend, we provide a bogus cache ID.
29
- context.headers['x-magento-cache-id'] =
30
- `random-cache-id${Math.random().toString(36).slice(2)}`
30
+ headers['x-magento-cache-id'] = `random-cache-id${Math.random().toString(36).slice(2)}`
31
31
  }
32
- return context
32
+ return { headers }
33
33
  }),
34
34
  ],
35
35
  }
@@ -7,7 +7,7 @@ import { test as base } from '@playwright/test'
7
7
  import { localeToStore } from '../utils/localeToStore'
8
8
 
9
9
  type ApolloClientStoreTest = {
10
- apolloClient: ApolloClient<NormalizedCacheObject>
10
+ apolloClient: ApolloClient
11
11
  }
12
12
 
13
13
  const test = base.extend<ApolloClientStoreTest>({
@@ -1,5 +1,5 @@
1
1
  import type { ParsedUrlQuery } from 'querystring'
2
- import type { ApolloClient, ApolloQueryResult, NormalizedCacheObject } from '@graphcommerce/graphql'
2
+ import type { ApolloClient } from '@graphcommerce/graphql'
3
3
  import { flushMeasurePerf } from '@graphcommerce/graphql'
4
4
  import type { ProductInterfaceResolvers } from '@graphcommerce/graphql-mesh'
5
5
  import fragments from '@graphcommerce/graphql/generated/fragments.json'
@@ -64,8 +64,10 @@ const redirect = (from: string, to: string, permanent: boolean, locale?: string)
64
64
  }
65
65
 
66
66
  export async function redirectOrNotFound(
67
- client: ApolloClient<NormalizedCacheObject>,
68
- config: Promise<ApolloQueryResult<StoreConfigQuery>> | ApolloQueryResult<StoreConfigQuery>,
67
+ client: ApolloClient,
68
+ config:
69
+ | Promise<ApolloClient.QueryResult<StoreConfigQuery>>
70
+ | ApolloClient.QueryResult<StoreConfigQuery>,
69
71
  params?: ParsedUrlQuery,
70
72
  locale?: string,
71
73
  ): RedirectOr404Return {
@@ -76,7 +78,8 @@ export async function redirectOrNotFound(
76
78
 
77
79
  try {
78
80
  // Get the configured suffixes from the store config
79
- const { product_url_suffix, category_url_suffix } = (await config).data.storeConfig ?? {}
81
+ const configResult = await config
82
+ const { product_url_suffix, category_url_suffix } = configResult.data?.storeConfig ?? {}
80
83
 
81
84
  const candidates = new Set([from])
82
85