2
2
title : Quick Start
3
3
---
4
4
5
- Learn how to easily publish and query a subgraph on The Graph.
5
+ Learn how to easily publish and query a [ subgraph] ( /developing/developer-faqs/#1-what-is-a-subgraph ) on The Graph.
6
6
7
7
## Prerequisites for this guide
8
8
@@ -35,10 +35,10 @@ If your contract has events, the `init` command will automatically create a scaf
35
35
36
36
#### Create via Graph CLI
37
37
38
- Use the following command to create a subgraph in Subgraph Studio using CLI:
38
+ Use the following command to create a subgraph in Subgraph Studio using the CLI:
39
39
40
40
``` sh
41
- init --product subgraph-studio
41
+ graph init --product subgraph-studio
42
42
```
43
43
44
44
#### Create via Subgraph Studio
@@ -48,7 +48,7 @@ Subgraph Studio has a staging environment where you can create, manage, deploy,
48
48
1 . Go to [ Subgraph Studio] ( https://thegraph.com/studio/ ) and connect your wallet.
49
49
2 . Click “Create a Subgraph". It is recommended to name the subgraph in Title Case: "Subgraph Name Chain Name".
50
50
51
- For additional information on subgraph creation and CLI, see [ Creating a Subgraph] ( /developing/creating-a-subgraph ) .
51
+ For additional information on subgraph creation and the Graph CLI, see [ Creating a Subgraph] ( /developing/creating-a-subgraph ) .
52
52
53
53
### 3. Initialize Your Subgraph
54
54
@@ -60,7 +60,7 @@ The following command initializes your subgraph from an existing contract:
60
60
graph init --studio < SUBGRAPH_SLUG>
61
61
```
62
62
63
- > _ Note : If your contract was verified on Etherscan, then the ABI will automatically be created in the CLI._
63
+ > Note : If your contract was verified on Etherscan, then the ABI will automatically be created in the CLI.
64
64
65
65
You can find commands for your specific subgraph on the subgraph page in [ Subgraph Studio] ( https://thegraph.com/studio/ ) .
66
66
@@ -110,7 +110,9 @@ Remember, deploying is not the same as publishing.
110
110
2 . Authenticate and deploy your subgraph. The deploy key can be found on the Subgraph page in Subgraph Studio.
111
111
112
112
``` sh
113
+
113
114
graph auth --studio < DEPLOY_KEY>
115
+
114
116
graph deploy --studio < SUBGRAPH_SLUG>
115
117
```
116
118
@@ -123,10 +125,9 @@ If you’d like to examine your subgraph before publishing it to the network, yo
123
125
124
126
- Run a sample query.
125
127
- Analyze your subgraph in the dashboard to check information.
126
- - Check the logs on the dashboard to see if there are any errors with your subgraph.
127
- - The logs of an operational subgraph will look like this:
128
+ - Check the logs on the dashboard to see if there are any errors with your subgraph. The logs of an operational subgraph will look like this:
128
129
129
- ![ Subgraph logs] ( /img/subgraph-logs-image.png )
130
+ ![ Subgraph logs] ( /img/subgraph-logs-image.png )
130
131
131
132
### 7. Publish Your Subgraph to The Graph Network
132
133
@@ -144,15 +145,15 @@ As of version 0.73.0, you can also publish your subgraph with the Graph CLI.
144
145
1 . Open the ` graph-cli ` .
145
146
2 . Use the following commands:
146
147
147
- ``` sh
148
- graph codegen && graph build
149
- ```
148
+ ``` sh
149
+ graph codegen && graph build
150
+ ```
150
151
151
- Then,
152
+ Then,
152
153
153
- ``` sh
154
- graph publish
155
- ```
154
+ ``` sh
155
+ graph publish
156
+ ```
156
157
157
158
3 . A window will open, allowing you to connect your wallet, add metadata, and deploy your finalized subgraph to a network of your choice.
158
159
@@ -178,6 +179,6 @@ To save on gas costs, you can curate your subgraph in the same transaction you p
178
179
179
180
### 8. Query Your Subgraph
180
181
181
- Now, you can query your subgraph by sending GraphQL queries to your subgraph’ s Query URL, which you can find by clicking the Query button.
182
+ Now, you can query your subgraph by sending GraphQL queries to it' s Query URL, which you can find by clicking the Query button.
182
183
183
184
For more information about querying data from your subgraph, read [ Querying The Graph] ( /querying/querying-the-graph/ ) .
0 commit comments