@graphcommerce/magento-store 3.2.0 → 3.2.4

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/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as PageMeta } from './PageMeta'
2
2
  export * from './StoreConfig.gql'
3
3
  export * from './localeToStore'
4
+ export * from './link/createStoreLink'
4
5
 
5
6
  export { default as StoreSwitcherButton } from './switcher/StoreSwitcherButton'
6
7
  export * from './switcher/StoreSwitcherButton'
@@ -0,0 +1,10 @@
1
+ import { setContext } from '@apollo/client/link/context'
2
+ import { localeToStore } from '../localeToStore'
3
+
4
+ /** Apollo link to set the store header in the context */
5
+ export const createStoreLink = (locale: string) =>
6
+ setContext((_, context) => {
7
+ if (!context.headers) context.headers = {}
8
+ context.headers.store = localeToStore(locale)
9
+ return context
10
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-store",
3
- "version": "3.2.0",
3
+ "version": "3.2.4",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.4.16",
24
- "@graphcommerce/graphql": "^2.105.2",
24
+ "@graphcommerce/graphql": "^2.105.3",
25
25
  "@graphcommerce/image": "^2.105.2",
26
- "@graphcommerce/next-ui": "^3.12.0",
26
+ "@graphcommerce/next-ui": "^3.12.4",
27
27
  "@graphql-typed-document-node/core": "^3.1.0",
28
28
  "@material-ui/core": "^4.12.3",
29
29
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -32,5 +32,5 @@
32
32
  "react-dom": "^17.0.2",
33
33
  "type-fest": "^2.5.1"
34
34
  },
35
- "gitHead": "b37db76e3e0dfc34a2b25068be5e6c7afcca6bfa"
35
+ "gitHead": "7aca802dd74632aa2f474eae2d93bd563490fd90"
36
36
  }