@graphcommerce/magento-store 10.0.0-canary.68 → 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,17 @@
|
|
|
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
|
+
|
|
3
15
|
## 10.0.0-canary.68
|
|
4
16
|
|
|
5
17
|
## 10.0.0-canary.67
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { ApolloClient
|
|
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
|
}
|
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.
|
|
5
|
+
"version": "10.0.0-canary.72",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"./mesh/resolvers.ts": "./mesh/resolvers.ts"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@graphcommerce/ecommerce-ui": "^10.0.0-canary.
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
24
|
-
"@graphcommerce/framer-utils": "^10.0.0-canary.
|
|
25
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
26
|
-
"@graphcommerce/graphql-mesh": "^10.0.0-canary.
|
|
27
|
-
"@graphcommerce/image": "^10.0.0-canary.
|
|
28
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
29
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
30
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
68
|
-
config:
|
|
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
|
|
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
|
|