@graphcommerce/docs 6.2.0-canary.82 → 6.2.0-canary.84

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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.84
4
+
5
+ ## 6.2.0-canary.83
6
+
3
7
  ## 6.2.0-canary.82
4
8
 
5
9
  ## 6.2.0-canary.81
@@ -183,6 +183,10 @@ The Google Tagmanager ID to be used on the site.
183
183
 
184
184
  This value is required even if you are configuring different values for each locale.
185
185
 
186
+ #### `hygraphProjectId: String`
187
+
188
+ Hygraph Project ID. **Only used for migrations.**
189
+
186
190
  #### `hygraphWriteAccessEndpoint: String`
187
191
 
188
192
  Content API. **Only used for migrations.**
@@ -210,6 +214,12 @@ Project settings -> API Access -> Permanent Auth Tokens
210
214
  - Delete existing components
211
215
  - Update remote sources
212
216
  - Delete remote sources
217
+ - Read existing environments
218
+ - Read public content views
219
+ - Create public content views
220
+ - Update public content views
221
+ - Delete public content views
222
+ - Can see schema view
213
223
 
214
224
  ```
215
225
  GC_HYGRAPH_WRITE_ACCESS_ENDPOINT="https://...hygraph.com/v2/..."
package/hygraph/cli.md ADDED
@@ -0,0 +1,63 @@
1
+ ---
2
+ menu: Hygraph cli
3
+ ---
4
+
5
+ # Hygraph migrate cli
6
+
7
+ It is possible to upgrade your Hygraph schema using the Graphcommerce Hygraph
8
+ CLI: `yarn graphcommerce hygraph-migrate`
9
+
10
+ This is a tool that automatically modifies your Hygraph schema without having to
11
+ add models, components field and enumerations manually.
12
+
13
+ Please note that:
14
+
15
+ - All migrations are backwards compatible with previous versions of
16
+ GraphCommerce. This means that after running a migration, older versions of
17
+ GraphCommerce will still work (unless specified otherwise)
18
+
19
+ - There is no rollback functionality in the Hygraph migrate cli. Please create a
20
+ copy of the project to test te migration on first. Once you run a migration,
21
+ you can't undo these schema changes with the CLI. You will be required
22
+ rollback the from the UI yourself.
23
+
24
+ ### Steps
25
+
26
+ The following steps are needed to utilize this tool:
27
+
28
+ 1. Create a Hygraph migration token
29
+ 1. Open your Hygraph project. Go to: Project settings > Permanent auth tokens
30
+ 2. Click 'Add token' and give it a name, something like 'GraphCommerce Write
31
+ Access Token' and keep stage on 'Published'.
32
+ 3. Under 'Management API', click 'Yes, Initialize defaults'
33
+ 4. Click 'Edit Permissions' and enable: 'Update' and 'Delete' permissions for
34
+ 'models', 'enumerations', 'fields', 'components' and 'sources':
35
+ - Update existing models
36
+ - Delete existing models
37
+ - Update existing fields
38
+ - Delete existing fields
39
+ - Update existing enumerations
40
+ - Delete existing enumerations
41
+ - Update existing components
42
+ - Delete existing components
43
+ - Update remote sources
44
+ - Delete remote sources
45
+ - Read existing environments
46
+ - Read public content views
47
+ - Create public content views
48
+ - Update public content views
49
+ - Delete public content views
50
+ - Can see schema view
51
+ 5. Add this new token to your env file: `GC_HYGRAPH_WRITE_ACCESS_TOKEN=""`
52
+ 2. Add the Content API key to your env file like this:
53
+ 1. Open your Hygraph project. Go to: Project settings -> API Access
54
+ 2. Copy the Content API URL and add to your env file:
55
+ `GC_HYGRAPH_WRITE_ACCESS_ENDPOINT=""`
56
+ 3. Add your hygraphProjectId to your env file like this:
57
+ 1. Copy the project ID from the URL when logged in
58
+ `https://app.hygraph.com/PROJECT_ID_IS_HERE/master`
59
+ 2. Add the project ID to your env file: `GC_HYGRAPH_PROJECT_ID=””`
60
+ 4. Run `yarn graphcommerce hygraph-migrate`
61
+ 5. Select the migration you want to run and press enter.
62
+ 6. The migrations should now be applied, check your Hygraph Schema if changes
63
+ are made.
@@ -1,5 +1,5 @@
1
1
  ---
2
- menu: Hygraph
2
+ menu: Overview
3
3
  ---
4
4
 
5
5
  # Hygraph
@@ -66,3 +66,4 @@ Is used to add a`RowProduct (variant:Grid)` and a
66
66
 
67
67
  - Learn how to
68
68
  [build a custom Hygraph component](../getting-started/graphcms-component.md)
69
+ - Learn how to [upgrade your Hygraph schema](./upgrading.md)
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": "6.2.0-canary.82",
5
+ "version": "6.2.0-canary.84",
6
6
  "sideEffects": true,
7
7
  "devDependencies": {
8
- "@graphcommerce/prettier-config-pwa": "6.2.0-canary.82"
8
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.84"
9
9
  },
10
10
  "prettier": "@graphcommerce/prettier-config-pwa"
11
11
  }
@@ -1,11 +1,13 @@
1
- # Upgrading from GraphCommerce 6.1 to 6.2
1
+ # Upgrading from GraphCommerce 6 to 7
2
2
 
3
- Upgrading from GraphCommerce 6.1 to 6.2 is minor update. Depending on the
4
- amounts of customisations you've made, there are some manual steps. Please
5
- follow the regular [upgrade steps first](./readme.md).
3
+ Depending on the amounts of customisations you've made, there are some manual
4
+ steps. Please follow the regular [upgrade steps first](./readme.md).
6
5
 
7
6
  1. [Add `fetchPolicy: cache-first` to LayoutDocument](#add-cache-first-fetchpolicy-to-layoutdocument)
8
- 2. [Translation file updates](#translation-file-updates)
7
+ 2. [Use thew new `hygraphPageContent` function instead of DefaultPageQuery](#use-the-new-hygraphpagecontent-function-instead-of-defaultpagequery)
8
+ 3. [Translation file updates](#translation-file-updates)
9
+ 4. [All @graphql-mesh/\* should be set to latest](#all-graphql-mesh-should-be-set-to-latest)
10
+ 5. [Upgrading your Hygraph schema](#upgrading-your-hygraph-schema)
9
11
 
10
12
  ## Add `fetchPolicy: cache-first` to LayoutDocument queries
11
13
 
@@ -22,7 +24,7 @@ staticClient.query({ query: LayoutDocument })
22
24
  staticClient.query({ query: LayoutDocument, fetchPolicy: 'cache-first' })
23
25
  ```
24
26
 
25
- ## Use thew new `hygraphPageContent` function instead of DefaultPageQuery
27
+ ## Use the new `hygraphPageContent` function instead of DefaultPageQuery
26
28
 
27
29
  🟠 Only required if you've added custom pages
28
30
 
@@ -87,3 +89,8 @@ In your package.json
87
89
  "@graphql-mesh/json-schema": "latest",
88
90
  "@graphql-mesh/transform-filter-schema": "latest",
89
91
  ```
92
+
93
+ ## Upgrading your Hygraph schema
94
+
95
+ Upgrade your Hygraph schema with the [Hygraph migration cli](../hygraph/cli.md).
96
+ Select `graphcommerce6to7` as version.
@@ -107,7 +107,7 @@ find . -type f -name '*.rej' -delete
107
107
  After resolving the diff issues, manually process upgrade instructions:
108
108
 
109
109
  - [Upgrading to GraphCommerce 5 to 6](../upgrading/graphcommerce-5-to-6.md)
110
- - [Upgrading to GraphCommerce 6.1 to 6.2](../upgrading/graphcommerce-6-1-to-6-2.md)
110
+ - [Upgrading to GraphCommerce 6 to 7](../upgrading/graphcommerce-6-to-7.md)
111
111
 
112
112
  Run and validate your local environment:
113
113