@graphcommerce/docs 8.1.0-canary.41 → 8.1.0-canary.43
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/framework/config.md +2 -0
- package/framework/preview-mode.md +31 -0
- package/framework/static-generation.md +4 -2
- package/getting-started/pages.md +10 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/framework/config.md
CHANGED
|
@@ -181,6 +181,8 @@ Enable customer account deletion through the account section
|
|
|
181
181
|
|
|
182
182
|
#### dataLayer: [DatalayerConfig](#DatalayerConfig)
|
|
183
183
|
|
|
184
|
+
Datalayer config
|
|
185
|
+
|
|
184
186
|
#### debug: [GraphCommerceDebugConfig](#GraphCommerceDebugConfig)
|
|
185
187
|
|
|
186
188
|
Debug configuration for GraphCommerce
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Preview mode
|
|
2
|
+
|
|
3
|
+
GraphCommerce implements Next.js' preview mode which allows you to view the
|
|
4
|
+
realtime data from Magento and Hygraph.
|
|
5
|
+
|
|
6
|
+
You can select whether to view Hygraph content in the DRAFT of PUBLISHED stage
|
|
7
|
+
(or other if configured).
|
|
8
|
+
|
|
9
|
+
You can Revalidate / Regenerate a page to make sure it is always up to date when
|
|
10
|
+
viewing.
|
|
11
|
+
|
|
12
|
+
It bypasses all caches from Next.js, Magento and Hygraph (this means that
|
|
13
|
+
Preview Mode is expdcted to be slower but does show your changes directly).
|
|
14
|
+
|
|
15
|
+
## Accessing preview mode
|
|
16
|
+
|
|
17
|
+
To enter preview mode press `ALT + Backtick` (\`) on your keyboard. This will
|
|
18
|
+
open the preview mode toolbar on the bottom of the screen.
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Fill in the secret and press the chevron button to enter preview mode.
|
|
23
|
+
|
|
24
|
+
You are now greeted with the preview mode toolbar:
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
## Enabling preview mode
|
|
29
|
+
|
|
30
|
+
Configure the `previewSecret` in your `graphcommerce.config.js` file to enable
|
|
31
|
+
preview mode.
|
|
@@ -43,8 +43,10 @@ data needed to render the layout (header, footer, menu etc.)
|
|
|
43
43
|
|
|
44
44
|
export const getStaticProps: GetPageStaticProps = async ({ locale }) => {
|
|
45
45
|
...
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const layout = staticClient.query({
|
|
47
|
+
query: LayoutDocument,
|
|
48
|
+
fetchPolicy: cacheFirst(staticClient),
|
|
49
|
+
})
|
|
48
50
|
|
|
49
51
|
return {
|
|
50
52
|
props: {
|
package/getting-started/pages.md
CHANGED
|
@@ -93,9 +93,9 @@ AboutUs.pageOptions = pageOptions
|
|
|
93
93
|
|
|
94
94
|
export default AboutUs
|
|
95
95
|
|
|
96
|
-
export const getStaticProps: GetPageStaticProps = async (
|
|
97
|
-
const client = graphqlSharedClient(
|
|
98
|
-
const staticClient = graphqlSsrClient(
|
|
96
|
+
export const getStaticProps: GetPageStaticProps = async (context) => {
|
|
97
|
+
const client = graphqlSharedClient(context)
|
|
98
|
+
const staticClient = graphqlSsrClient(context)
|
|
99
99
|
|
|
100
100
|
const conf = client.query({ query: StoreConfigDocument })
|
|
101
101
|
const layout = staticClient.query({
|
|
@@ -210,9 +210,9 @@ AboutUs.pageOptions = pageOptions
|
|
|
210
210
|
|
|
211
211
|
export default AboutUs
|
|
212
212
|
|
|
213
|
-
export const getStaticProps: GetPageStaticProps = async (
|
|
214
|
-
const client = graphqlSharedClient(
|
|
215
|
-
const staticClient = graphqlSsrClient(
|
|
213
|
+
export const getStaticProps: GetPageStaticProps = async (context) => {
|
|
214
|
+
const client = graphqlSharedClient(context)
|
|
215
|
+
const staticClient = graphqlSsrClient(context)
|
|
216
216
|
|
|
217
217
|
const conf = client.query({ query: StoreConfigDocument })
|
|
218
218
|
const page = hygraphPageContent(staticClient, 'about/about-us')
|
|
@@ -259,12 +259,10 @@ export const getStaticPaths: GetPageStaticPaths = (context) => ({
|
|
|
259
259
|
fallback: 'blocking',
|
|
260
260
|
})
|
|
261
261
|
|
|
262
|
-
export const getStaticProps: GetPageStaticProps = async ({
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const client = graphqlSharedClient(locale)
|
|
267
|
-
const staticClient = graphqlSsrClient(locale)
|
|
262
|
+
export const getStaticProps: GetPageStaticProps = async (context) => {
|
|
263
|
+
const { params } = context
|
|
264
|
+
const client = graphqlSharedClient(context)
|
|
265
|
+
const staticClient = graphqlSsrClient(context)
|
|
268
266
|
|
|
269
267
|
const conf = client.query({ query: StoreConfigDocument })
|
|
270
268
|
const page = hygraphPageContent(staticClient, `about/${params?.url}`)
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@graphcommerce/docs",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/docs",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce/docs",
|
|
5
|
-
"version": "8.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.43",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
|
8
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.43"
|
|
9
9
|
},
|
|
10
10
|
"prettier": "@graphcommerce/prettier-config-pwa"
|
|
11
11
|
}
|