@graphcommerce/hygraph-dynamic-rows 8.1.0-canary.5 → 8.1.0-canary.52
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,104 @@
|
|
|
1
1
|
# @graphcommerce/hygraph-dynamic-rows
|
|
2
2
|
|
|
3
|
+
## 8.1.0-canary.52
|
|
4
|
+
|
|
5
|
+
## 8.1.0-canary.51
|
|
6
|
+
|
|
7
|
+
## 8.1.0-canary.50
|
|
8
|
+
|
|
9
|
+
## 8.1.0-canary.49
|
|
10
|
+
|
|
11
|
+
## 8.1.0-canary.48
|
|
12
|
+
|
|
13
|
+
## 8.1.0-canary.47
|
|
14
|
+
|
|
15
|
+
## 8.1.0-canary.46
|
|
16
|
+
|
|
17
|
+
## 8.1.0-canary.45
|
|
18
|
+
|
|
19
|
+
## 8.1.0-canary.44
|
|
20
|
+
|
|
21
|
+
## 8.1.0-canary.43
|
|
22
|
+
|
|
23
|
+
## 8.1.0-canary.42
|
|
24
|
+
|
|
25
|
+
## 8.1.0-canary.41
|
|
26
|
+
|
|
27
|
+
## 8.1.0-canary.40
|
|
28
|
+
|
|
29
|
+
## 8.1.0-canary.39
|
|
30
|
+
|
|
31
|
+
## 8.1.0-canary.38
|
|
32
|
+
|
|
33
|
+
## 8.1.0-canary.37
|
|
34
|
+
|
|
35
|
+
## 8.1.0-canary.36
|
|
36
|
+
|
|
37
|
+
## 8.1.0-canary.35
|
|
38
|
+
|
|
39
|
+
## 8.1.0-canary.34
|
|
40
|
+
|
|
41
|
+
## 8.1.0-canary.33
|
|
42
|
+
|
|
43
|
+
## 8.1.0-canary.32
|
|
44
|
+
|
|
45
|
+
## 8.1.0-canary.31
|
|
46
|
+
|
|
47
|
+
## 8.1.0-canary.30
|
|
48
|
+
|
|
49
|
+
## 8.1.0-canary.29
|
|
50
|
+
|
|
51
|
+
## 8.1.0-canary.28
|
|
52
|
+
|
|
53
|
+
## 8.1.0-canary.27
|
|
54
|
+
|
|
55
|
+
## 8.1.0-canary.26
|
|
56
|
+
|
|
57
|
+
## 8.1.0-canary.25
|
|
58
|
+
|
|
59
|
+
## 8.1.0-canary.24
|
|
60
|
+
|
|
61
|
+
## 8.1.0-canary.23
|
|
62
|
+
|
|
63
|
+
## 8.1.0-canary.22
|
|
64
|
+
|
|
65
|
+
## 8.1.0-canary.21
|
|
66
|
+
|
|
67
|
+
## 8.1.0-canary.20
|
|
68
|
+
|
|
69
|
+
## 8.1.0-canary.19
|
|
70
|
+
|
|
71
|
+
## 8.1.0-canary.18
|
|
72
|
+
|
|
73
|
+
## 8.1.0-canary.17
|
|
74
|
+
|
|
75
|
+
## 8.1.0-canary.16
|
|
76
|
+
|
|
77
|
+
## 8.1.0-canary.15
|
|
78
|
+
|
|
79
|
+
## 8.1.0-canary.14
|
|
80
|
+
|
|
81
|
+
## 8.1.0-canary.13
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- [#2268](https://github.com/graphcommerce-org/graphcommerce/pull/2268) [`8ffe2d5`](https://github.com/graphcommerce-org/graphcommerce/commit/8ffe2d5d1b040797ee4987d7740de5fdeadd4f72) - Fix for non extensible object error in Dynamic Row package
|
|
86
|
+
([@JoshuaS98](https://github.com/JoshuaS98))
|
|
87
|
+
|
|
88
|
+
## 8.1.0-canary.12
|
|
89
|
+
|
|
90
|
+
## 8.1.0-canary.11
|
|
91
|
+
|
|
92
|
+
## 8.1.0-canary.10
|
|
93
|
+
|
|
94
|
+
## 8.1.0-canary.9
|
|
95
|
+
|
|
96
|
+
## 8.1.0-canary.8
|
|
97
|
+
|
|
98
|
+
## 8.1.0-canary.7
|
|
99
|
+
|
|
100
|
+
## 8.1.0-canary.6
|
|
101
|
+
|
|
3
102
|
## 8.1.0-canary.5
|
|
4
103
|
|
|
5
104
|
## 8.0.6-canary.4
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApolloClient, NormalizedCacheObject, ApolloQueryResult } from '@apollo/client'
|
|
2
|
+
import { cacheFirst } from '@graphcommerce/graphql'
|
|
2
3
|
import { AllDynamicRowsDocument, AllDynamicRowsQuery } from '../graphql'
|
|
3
4
|
|
|
4
5
|
type DynamicRows = AllDynamicRowsQuery['dynamicRows']
|
|
@@ -8,10 +9,11 @@ export async function getAllHygraphDynamicRows(
|
|
|
8
9
|
options: { pageSize?: number } = {},
|
|
9
10
|
) {
|
|
10
11
|
const { pageSize = 100 } = options
|
|
12
|
+
|
|
11
13
|
const query = client.query({
|
|
12
14
|
query: AllDynamicRowsDocument,
|
|
13
15
|
variables: { first: pageSize },
|
|
14
|
-
fetchPolicy:
|
|
16
|
+
fetchPolicy: cacheFirst(client),
|
|
15
17
|
})
|
|
16
18
|
|
|
17
19
|
const pages: Promise<ApolloQueryResult<AllDynamicRowsQuery>>[] = [query]
|
|
@@ -24,7 +26,7 @@ export async function getAllHygraphDynamicRows(
|
|
|
24
26
|
client.query({
|
|
25
27
|
query: AllDynamicRowsDocument,
|
|
26
28
|
variables: { first: pageSize, skip: pageSize * (i - 1) },
|
|
27
|
-
fetchPolicy:
|
|
29
|
+
fetchPolicy: cacheFirst(client),
|
|
28
30
|
}),
|
|
29
31
|
)
|
|
30
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HygraphPagesQuery } from '@graphcommerce/graphcms-ui'
|
|
2
|
-
import { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql'
|
|
2
|
+
import { ApolloClient, NormalizedCacheObject, cacheFirst } from '@graphcommerce/graphql'
|
|
3
3
|
import {
|
|
4
4
|
ConditionTextFragment,
|
|
5
5
|
ConditionNumberFragment,
|
|
@@ -94,8 +94,7 @@ export async function hygraphDynamicRows(
|
|
|
94
94
|
cached: boolean,
|
|
95
95
|
additionalProperties?: Promise<object> | object,
|
|
96
96
|
): Promise<{ data: HygraphPagesQuery }> {
|
|
97
|
-
const
|
|
98
|
-
const fetchPolicy = cached ? alwaysCache : undefined
|
|
97
|
+
const fetchPolicy = cached ? cacheFirst(client) : undefined
|
|
99
98
|
|
|
100
99
|
const allRoutes = await getAllHygraphDynamicRows(client)
|
|
101
100
|
|
|
@@ -117,7 +116,7 @@ export async function hygraphDynamicRows(
|
|
|
117
116
|
const page = pageResult.data.pages[0] as Page | undefined
|
|
118
117
|
|
|
119
118
|
// Create a copy of the content array.
|
|
120
|
-
const content = page?.content ?? []
|
|
119
|
+
const content = [...(page?.content ?? [])]
|
|
121
120
|
|
|
122
121
|
dynamicResult?.data.dynamicRows.forEach((dynamicRow) => {
|
|
123
122
|
const { placement, target, rows, row } = dynamicRow
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/hygraph-dynamic-rows",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "8.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.52",
|
|
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": "^8.1.0-canary.
|
|
16
|
-
"@graphcommerce/graphcms-ui": "^8.1.0-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^8.1.0-canary.
|
|
18
|
-
"@graphcommerce/image": "^8.1.0-canary.
|
|
19
|
-
"@graphcommerce/next-ui": "^8.1.0-canary.
|
|
20
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
|
21
|
-
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.52",
|
|
16
|
+
"@graphcommerce/graphcms-ui": "^8.1.0-canary.52",
|
|
17
|
+
"@graphcommerce/graphql": "^8.1.0-canary.52",
|
|
18
|
+
"@graphcommerce/image": "^8.1.0-canary.52",
|
|
19
|
+
"@graphcommerce/next-ui": "^8.1.0-canary.52",
|
|
20
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.52",
|
|
21
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.52",
|
|
22
22
|
"@mui/material": "^5.10.16",
|
|
23
23
|
"next": "*",
|
|
24
24
|
"react": "^18.2.0",
|