@graphcommerce/magento-recently-viewed-products 10.0.1-canary.0 → 10.0.1-canary.2
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 +8 -0
- package/index.ts +1 -0
- package/package.json +12 -11
- package/plugins/AddRecentlyViewedProductsTypePolicies.tsx +13 -0
- package/typePolicies.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphcommerce/magento-recently-viewed-products
|
|
2
2
|
|
|
3
|
+
## 10.0.1-canary.2
|
|
4
|
+
|
|
5
|
+
## 10.0.1-canary.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#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))
|
|
10
|
+
|
|
3
11
|
## 10.0.1-canary.0
|
|
4
12
|
|
|
5
13
|
## 10.0.0
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-recently-viewed-products",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.1-canary.
|
|
5
|
+
"version": "10.0.1-canary.2",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.1-canary.
|
|
16
|
-
"@graphcommerce/graphql": "^10.0.1-canary.
|
|
17
|
-
"@graphcommerce/graphql-mesh": "^10.0.1-canary.
|
|
18
|
-
"@graphcommerce/magento-cart": "^10.0.1-canary.
|
|
19
|
-
"@graphcommerce/magento-product": "^10.0.1-canary.
|
|
20
|
-
"@graphcommerce/magento-product-configurable": "^10.0.1-canary.
|
|
21
|
-
"@graphcommerce/next-config": "^10.0.1-canary.
|
|
22
|
-
"@graphcommerce/next-ui": "^10.0.1-canary.
|
|
23
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.1-canary.
|
|
24
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.1-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.1-canary.2",
|
|
16
|
+
"@graphcommerce/graphql": "^10.0.1-canary.2",
|
|
17
|
+
"@graphcommerce/graphql-mesh": "^10.0.1-canary.2",
|
|
18
|
+
"@graphcommerce/magento-cart": "^10.0.1-canary.2",
|
|
19
|
+
"@graphcommerce/magento-product": "^10.0.1-canary.2",
|
|
20
|
+
"@graphcommerce/magento-product-configurable": "^10.0.1-canary.2",
|
|
21
|
+
"@graphcommerce/next-config": "^10.0.1-canary.2",
|
|
22
|
+
"@graphcommerce/next-ui": "^10.0.1-canary.2",
|
|
23
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.1-canary.2",
|
|
24
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.1-canary.2",
|
|
25
25
|
"@mui/material": "^7.0.0",
|
|
26
26
|
"framer-motion": "^11.0.0",
|
|
27
27
|
"next": "*",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": "./index.ts",
|
|
33
|
+
"./plugins/AddRecentlyViewedProductsTypePolicies": "./plugins/AddRecentlyViewedProductsTypePolicies.tsx",
|
|
33
34
|
"./plugins/RegisterProductAsRecentlyViewed": "./plugins/RegisterProductAsRecentlyViewed.tsx"
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GraphQLProviderProps } from '@graphcommerce/graphql'
|
|
2
|
+
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
|
+
import { recentlyViewedProductsTypePolicies } from '../typePolicies'
|
|
4
|
+
|
|
5
|
+
export const config: PluginConfig = {
|
|
6
|
+
type: 'component',
|
|
7
|
+
module: '@graphcommerce/graphql',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function GraphQLProvider(props: PluginProps<GraphQLProviderProps>) {
|
|
11
|
+
const { Prev, policies = [], ...rest } = props
|
|
12
|
+
return <Prev {...rest} policies={[...policies, recentlyViewedProductsTypePolicies]} />
|
|
13
|
+
}
|
package/typePolicies.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StrictTypedTypePolicies } from '@graphcommerce/graphql'
|
|
2
|
+
|
|
3
|
+
export const recentlyViewedProductsTypePolicies: StrictTypedTypePolicies = {
|
|
4
|
+
Query: {
|
|
5
|
+
fields: {
|
|
6
|
+
// https://github.com/apollographql/apollo-client/issues/12930
|
|
7
|
+
recentlyViewedProducts: { merge: (existing, incoming) => incoming ?? existing },
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
}
|