Skip to content

Commit d4e3588

Browse files
idalithbMichaelMacaulaybenface
authored
Breaking up creating subgraph flow (#811)
* updating copy & files * Improve error message + fix error --------- Co-authored-by: Michael Macaulay <[email protected]> Co-authored-by: benface <[email protected]>
1 parent 82da910 commit d4e3588

File tree

10 files changed

+1654
-1623
lines changed

10 files changed

+1654
-1623
lines changed

packages/nextra-theme/src/index.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,19 @@ export default function NextraLayout({ children, pageOpts, pageProps }: NextraTh
103103
})
104104
if (typeof window === 'undefined') {
105105
// Execute this check for sidebar links only on server, will be stripped from client build
106-
for (const item of result.flatDocsDirectories) {
107-
if (!item.route) {
108-
throw new Error(`Route "${item.name}" does not exist. Remove this field from _meta.js file`)
106+
const checkIfRouteExists = (item: (typeof result.docsDirectories)[number], baseRoute = '') => {
107+
const expectedRoute = `${baseRoute}/${item.name}`
108+
// TODO: When a page doesn't exist in languages other than English, `item.route` is `#` for some reason
109+
if (item.type === 'doc' && !item.route) {
110+
throw new Error(`Route "${expectedRoute}" does not exist. Remove this field from _meta.js file`)
111+
}
112+
if (item.children) {
113+
for (const child of item.children) {
114+
checkIfRouteExists(child, item.route)
115+
}
109116
}
110117
}
118+
result.docsDirectories.forEach((item) => checkIfRouteExists(item))
111119
}
112120
return result
113121
}, [defaultLocale, fsPath, locale, pageMap])

website/pages/en/cookbook/transfer-to-the-graph.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ graph init --product subgraph-studio
4848
In The Graph CLI, use the auth command seen in Subgraph Studio:
4949

5050
```sh
51-
graph auth --studio <your-auth-code>
51+
graph auth <your-auth-code>
5252
```
5353

5454
## 2. Deploy Your Subgraph to Studio
@@ -58,7 +58,7 @@ If you have your source code, you can easily deploy it to Studio. If you don't h
5858
In The Graph CLI, run the following command:
5959

6060
```sh
61-
graph deploy --studio <slug> --ipfs-hash <your-subgraph-ipfs-hash>
61+
graph deploy <slug> --ipfs-hash <your-subgraph-ipfs-hash>
6262

6363
```
6464

website/pages/en/developing/_meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
'supported-networks': '',
3-
'creating-a-subgraph': '',
3+
'creating-a-subgraph': 'Creating a Subgraph',
44
'graph-ts': 'AssemblyScript API',
55
'unit-testing-framework': '',
66
'developer-faqs': '',

website/pages/en/developing/creating-a-subgraph.mdx

Lines changed: 0 additions & 1617 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
'install-the-cli': '',
3+
'subgraph-manifest': '',
4+
'ql-schema': '',
5+
'assemblyscript-mappings': '',
6+
advanced: '',
7+
}

0 commit comments

Comments
 (0)