Skip to content

Commit 5c0c663

Browse files
committed
Edits
1 parent a1dc3be commit 5c0c663

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ title: Deploy Using Subgraph Studio
44

55
Learn how to deploy your subgraph in Subgraph Studio.
66

7-
> Note: When you deploy a subgraph, you push it to Subgraph Studio, where you'll be able to stage it. It's important to remember that deploying is not the same as publishing. When you publish a subgraph, you are publishing it on-chain.
7+
> Note: When you deploy a subgraph, you push it to Subgraph Studio, where you'll be able to stage it. It's important to remember that deploying is not the same as publishing. When you publish a subgraph, you're publishing it on-chain.
88
99
## Subgraph Studio Overview
1010

1111
In [Subgraph Studio](https://thegraph.com/studio/), you can do the following:
1212

1313
- Create and manage your API keys for specific subgraphs
14-
- Create your subgraph
15-
- Authenticate your account from the CLI
16-
- Deploy your subgraph
14+
- Create your subgraph through Studio UI
15+
- Deploy your subgraph using the CLI
16+
- Publish your subgraph with the Studio UI
1717
- Stage your subgraph in the playground environment
1818
- Integrate your subgraph in staging using the query URL
19+
- Restrict your API keys to specific domains and allow only certain Indexers to query with them
1920

2021
In [Subgraph Studio](https://thegraph.com/studio/), you can view the following:
2122

@@ -43,23 +44,21 @@ yarn global add @graphprotocol/graph-cli
4344
npm install -g @graphprotocol/graph-cli
4445
```
4546

46-
## Create your subgraph
47+
## Create your Subgraph
4748

48-
### Create an account
49+
### Create an Account
4950

5051
Before deploying your subgraph you need to create a subgraph in [Subgraph Studio](https://thegraph.com/studio/).
5152

5253
1. Open [Subgraph Studio](https://thegraph.com/studio/).
53-
2. Connect your wallet.
54-
- You can do this via MetaMask, WalletConnect, Coinbase Wallet, or Safe.
55-
3. After you connect your wallet, your unique deploy key will be displayed on your "My Subgraphs" page or your “subgraph details” page in the Studio.
54+
2. Connect your wallet to sign in.
55+
- You can do this via MetaMask, Coinbase Wallet, WalletConnect, or Safe.
56+
3. After you sign in, your unique deploy key will be displayed on your account home page.
5657
- The deploy key allows you to publish your subgraphs or manage your API keys and billing. It is unique but can be regenerated if you think it has been compromised.
57-
4. You can create one or multiple API keys by clicking the API keys tab at the top of your homepage. See image below:
58-
- You can limit API keys to a specific domain in the security section.
5958

6059
> Important: You need API keys to query subgraphs
6160
62-
#### How to create a subgraph in Subgraph Studio
61+
#### How to Create a Subgraph in Subgraph Studio
6362

6463
<VideoEmbed youtube="nGIFuC69bSA" />
6564

@@ -75,31 +74,31 @@ In order to be supported by Indexers on The Graph Network, subgraphs must:
7574
- Non-fatal errors
7675
- Grafting
7776

78-
## Initialize your subgraph
77+
## Initialize your Subgraph
7978

80-
Once your subgraph has been created in Subgraph Studio you can initialize the subgraph code using this command:
79+
Once your subgraph has been created in Subgraph Studio, you can initialize the subgraph code through the CLI using this command:
8180

8281
```bash
8382
graph init --studio <SUBGRAPH_SLUG>
8483
```
8584

86-
You can view the `<SUBGRAPH_SLUG>` value on your subgraph details page in Subgraph Studio, see image below:
85+
You can find the `<SUBGRAPH_SLUG>` value on your subgraph details page in Subgraph Studio, see image below:
8786

8887
![Subgraph Studio - Slug](/img/doc-subgraph-slug.png)
8988

9089
After running `graph init`, you will be asked to input the contract address, network, and an ABI that you want to query. This will generate a new folder on your local machine with some basic code to start working on your subgraph. You can then finalize your subgraph to make sure it works as expected.
9190

9291
## Graph Auth
9392

94-
Before can deploy your subgraph to Subgraph Studio, you must login into your account using the CLI. To do this, you will need your deploy key, which you can find on your "My Subgraphs" page or under your subgraph details page.
93+
Before you can deploy your subgraph to Subgraph Studio, you need to login into your account within the CLI. To do this, you will need your deploy key, which you can find on your "My Subgraphs" page or under your subgraph details page.
9594

9695
Then, use the following command to authenticate from the CLI:
9796

9897
```bash
9998
graph auth --studio <DEPLOY KEY>
10099
```
101100

102-
## Deploying a subgraph
101+
## Deploying a Subgraph
103102

104103
Once you are ready, you can deploy your subgraph to Subgraph Studio.
105104

@@ -116,14 +115,30 @@ After running this command, the CLI will ask for a version label.
116115
- It's strongly recommended to use [semver](https://semver.org/) for versioning like `0.0.1`. That said, you are free to choose any string as version such as:`v1`, `version1`, `asdf`.
117116
- The labels you create will be visible in Graph Explorer and can be used by curators to decide if they want to signal on a specific version or not, so choose them wisely.
118117

119-
## Testing your subgraph
118+
## Testing your Subgraph
120119

121120
After deploying, you can test/stage your subgraph in Subgraph Studio, deploy another version, update the metadata, and publish to [Graph Explorer](https://thegraph.com/explorer) when you are ready.
122121

123122
Use Subgraph Studio’s playground to check your subgraph logs and see where a subgraph fails.
124123

125-
## Publish your subgraph
126-
127-
You are now ready to publish your subgraph!
124+
## Publish your Subgraph
128125

129126
In order to publish your subgraph successfully, review [publishing a subgraph](/publishing/publishing-a-subgraph/).
127+
128+
## Versioning your Subgraph with the CLI
129+
130+
If you want to update your subgraph, you can do the following:
131+
132+
- You can deploy a new version to the Studio using the CLI (it will only be private at this point).
133+
- Once you're happy with it, you can publish your new deployment to [Graph Explorer](https://thegraph.com/explorer).
134+
- This action will create a new version of your subgraph that curators can start signaling on and Indexers can index.
135+
136+
You can also update your subgraphs' metadata without publishing a new version. You can update your subgraph details in the Studio (under the profile picture, name, description, etc.) by checking an option called **Update Details** in Graph Explorer. If this is checked, an on-chain transaction will be generated that updates subgraph details in the Explorer without having to publish a new version with a new deployment.
137+
138+
> Note: There are costs associated with publishing a new version of a subgraph to the network. In addition to the transaction fees, you must also fund a part of the curation tax on the auto-migrating signal. You cannot publish a new version of your subgraph if curators have not signaled on it. For more information on the risks of curation, please read more [here](/network/curating/).
139+
140+
## Automatic Archiving of Subgraph Versions
141+
142+
Whenever you deploy a new subgraph version in Subgraph Studio, the previous version will be archived. Archived versions won't be indexed/synced and therefore cannot be queried. You can unarchive an archived version of your subgraph in the Studio UI.
143+
144+
> Note: Previous versions of non-published subgraphs deployed to the Studio will be automatically archived.

0 commit comments

Comments
 (0)