Skip to content

Commit

Permalink
Breaking up creating subgraph flow (#811)
Browse files Browse the repository at this point in the history
* updating copy & files
* Improve error message + fix error

---------

Co-authored-by: Michael Macaulay <56690114+MichaelMacaulay@users.noreply.github.com>
Co-authored-by: benface <benoit.rouleau@icloud.com>
  • Loading branch information
3 people authored Dec 4, 2024
1 parent 82da910 commit d4e3588
Show file tree
Hide file tree
Showing 10 changed files with 1,654 additions and 1,623 deletions.
14 changes: 11 additions & 3 deletions packages/nextra-theme/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,19 @@ export default function NextraLayout({ children, pageOpts, pageProps }: NextraTh
})
if (typeof window === 'undefined') {
// Execute this check for sidebar links only on server, will be stripped from client build
for (const item of result.flatDocsDirectories) {
if (!item.route) {
throw new Error(`Route "${item.name}" does not exist. Remove this field from _meta.js file`)
const checkIfRouteExists = (item: (typeof result.docsDirectories)[number], baseRoute = '') => {
const expectedRoute = `${baseRoute}/${item.name}`
// TODO: When a page doesn't exist in languages other than English, `item.route` is `#` for some reason
if (item.type === 'doc' && !item.route) {
throw new Error(`Route "${expectedRoute}" does not exist. Remove this field from _meta.js file`)
}
if (item.children) {
for (const child of item.children) {
checkIfRouteExists(child, item.route)
}
}
}
result.docsDirectories.forEach((item) => checkIfRouteExists(item))
}
return result
}, [defaultLocale, fsPath, locale, pageMap])
Expand Down
4 changes: 2 additions & 2 deletions website/pages/en/cookbook/transfer-to-the-graph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ graph init --product subgraph-studio
In The Graph CLI, use the auth command seen in Subgraph Studio:

```sh
graph auth --studio <your-auth-code>
graph auth <your-auth-code>
```

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

```sh
graph deploy --studio <slug> --ipfs-hash <your-subgraph-ipfs-hash>
graph deploy <slug> --ipfs-hash <your-subgraph-ipfs-hash>

```

Expand Down
2 changes: 1 addition & 1 deletion website/pages/en/developing/_meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
'supported-networks': '',
'creating-a-subgraph': '',
'creating-a-subgraph': 'Creating a Subgraph',
'graph-ts': 'AssemblyScript API',
'unit-testing-framework': '',
'developer-faqs': '',
Expand Down
1,617 changes: 0 additions & 1,617 deletions website/pages/en/developing/creating-a-subgraph.mdx

This file was deleted.

7 changes: 7 additions & 0 deletions website/pages/en/developing/creating-a-subgraph/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
'install-the-cli': '',
'subgraph-manifest': '',
'ql-schema': '',
'assemblyscript-mappings': '',
advanced: '',
}
Loading

0 comments on commit d4e3588

Please sign in to comment.