@graphcommerce/magento-store 9.0.0-canary.105 → 9.0.0-canary.107
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 +4 -0
- package/package.json +8 -8
- package/plugins/magentoStoreGraphqlConfig.ts +0 -39
package/CHANGELOG.md
CHANGED
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": "9.0.0-canary.
|
|
5
|
+
"version": "9.0.0-canary.107",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
|
16
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
|
17
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
|
18
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
|
19
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
|
20
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
|
21
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.107",
|
|
16
|
+
"@graphcommerce/graphql": "^9.0.0-canary.107",
|
|
17
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.107",
|
|
18
|
+
"@graphcommerce/image": "^9.0.0-canary.107",
|
|
19
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.107",
|
|
20
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.107",
|
|
21
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.107",
|
|
22
22
|
"@lingui/core": "^4.2.1",
|
|
23
23
|
"@lingui/macro": "^4.2.1",
|
|
24
24
|
"@lingui/react": "^4.2.1",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type graphqlConfig as graphqlConfigType, setContext } from '@graphcommerce/graphql'
|
|
2
|
-
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
3
|
-
|
|
4
|
-
export const config: PluginConfig = {
|
|
5
|
-
type: 'function',
|
|
6
|
-
module: '@graphcommerce/graphql',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare module '@graphcommerce/graphql/config' {
|
|
10
|
-
interface PreviewData {
|
|
11
|
-
magentoPreviewVersion?: string
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const graphqlConfig: FunctionPlugin<typeof graphqlConfigType> = (prev, conf) => {
|
|
16
|
-
const results = prev(conf)
|
|
17
|
-
|
|
18
|
-
const previewVersion = conf.previewData?.magentoPreviewVersion
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
...results,
|
|
22
|
-
links: [
|
|
23
|
-
...results.links,
|
|
24
|
-
setContext((_, context) => {
|
|
25
|
-
if (!context.headers) context.headers = {}
|
|
26
|
-
context.headers.store = conf.storefront.magentoStoreCode
|
|
27
|
-
if (conf.preview) {
|
|
28
|
-
// 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)}`
|
|
31
|
-
if (previewVersion) {
|
|
32
|
-
context.headers['preview-version'] = previewVersion
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return context
|
|
36
|
-
}),
|
|
37
|
-
],
|
|
38
|
-
}
|
|
39
|
-
}
|