Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Indexer Software
        • Gateway Software
          • Data Services
            • AI Tooling
            • Resources
              Subgraphs > Gateway Providers > Graph Foundation

              5 minutes

              Subgraph Studio

              Subgraph Studio is a web app, operated by The Graph Foundation, for creating, deploying, and publishing Subgraphs. Any developer can use it, whichever gateway they query through.

              What Users Can Do in Subgraph Studio

              Build and Publish Subgraphs

              These features work the same way whichever Gateway Provider you query through:

              • Create a Subgraph and get the deploy key for the Graph CLI.
              • View the Subgraphs you’ve created, and the details and status of each one.
              • Deploy versions and test them in the playground, with a development query URL, and with indexing logs.
              • Manage versions, including archiving and unarchiving them.
              • Publish a Subgraph to The Graph Network, add curation signal, update its metadata, and transfer ownership.

              Query Data via The Foundation Gateway

              • Create and manage API keys for gateway.thegraph.com, and restrict them to specific domains and Subgraphs.
              • Pay for queries with GRT or credit card.

              Subgraph Studio API keys and billing apply only to The Graph Foundation’s gateway. If you query through another Gateway Provider, get your API key and billing from that provider. Publishing in Studio does not tie your Subgraph to any gateway. See Subgraph Gateway Providers.

              Staging in Subgraph Studio

              Each version you deploy to Studio gets a development query URL, which you can use to test the Subgraph in your application before you publish it.

              • Each account is limited to 3 deployed (unpublished) Subgraphs. If you reach this limit, archive or publish existing Subgraphs before deploying new ones.
              • The development query URL allows up to 3,000 queries per day.
              • Studio indexes deployed versions with the Upgrade Indexer, which supports only some networks. Supported Networks shows which ones. On other networks, test locally instead. See Testing and Staging.

              Deploying is not the same as publishing. Deploying pushes a version to Studio for testing. Publishing is an onchain action that makes the Subgraph available to Indexers on The Graph Network, and there is no limit to how many Subgraphs you can publish.

              Build and Deploy a Subgraph with Subgraph Studio

              These steps follow the Quick Start, which also covers editing your Subgraph and troubleshooting first deploys.

              How to Deploy a Subgraph - A Step-By-Step Walkthrough

              0. Prerequisites

              • A crypto wallet⁠
              • A smart contract on a supported network. For the features Indexers support, see the Feature Support Matrix⁠.
              • Node.js⁠ and a package manager of your choice (npm, yarn, or pnpm)

              1. Create a Subgraph in Subgraph Studio

              1. Open Subgraph Studio.
              2. Connect your wallet to sign in. You can use MetaMask, Coinbase Wallet, WalletConnect, or Safe.
              3. Click Create a Subgraph and name it in Title Case, such as “Subgraph Name Chain Name”.

              Your Subgraph’s page shows its slug, its deploy key, and the CLI commands for your Subgraph.

              Subgraph Studio - Slug

              2. Install the Graph CLI

              Check for the most recent⁠ CLI version, then run one of the following:

              1npm install -g @graphprotocol/graph-cli@latest
              1yarn global add @graphprotocol/graph-cli

              Verify the install:

              1graph --version

              3. Initialize Your Subgraph

              1graph init

              The CLI asks for your Subgraph slug, the network, the contract address, the ABI, and the start block, then generates a folder with the code to start from. For each prompt, see Initialize your Subgraph in the Quick Start. Then edit the manifest, schema, and mappings as described in Creating a Subgraph.

              4. Build Your Subgraph

              1graph codegen && graph build

              5. Deploy to Subgraph Studio

              1. Copy the deploy key from your Subgraph’s page in Studio. The deploy key authenticates the CLI with your Studio account. You can regenerate it if you think it has been compromised.

                Deploy key
              2. Authenticate:

                1graph auth <DEPLOY_KEY>
              3. Deploy:

                1graph deploy <SUBGRAPH_SLUG>

              The CLI asks for a version label:

              • Use semver⁠, such as 0.0.1. Any string works, but labels are visible in Graph Explorer, and Curators use them to decide whether to signal on a version.
              • Labels must be unique within a Subgraph. Deploying with a label that already exists fails with a Version label already exists error.

              6. Test in Subgraph Studio

              In your Subgraph’s dashboard in Studio:

              • Run sample queries in the playground, or query the development query URL from your own app.

              • Check the indexing status and the logs for errors. The logs of an operational Subgraph look like this:

                Subgraph logs

              To fix an issue, edit your Subgraph, build it again, and deploy a new version.

              7. Publish to The Graph Network

              When your Subgraph is ready for production, click Publish in Studio, select a network, and add curation signal in the same transaction to save gas. You can also publish from the CLI with graph publish. See Publishing a Subgraph.

              You can publish without curation signal, but Indexers may not sync your Subgraph without it. See How Much Signal to Add.

              After publishing, query your Subgraph through any Gateway Provider. To use The Graph Foundation’s Gateway, create an API key on the API Keys page in Studio.

              Update a Published Subgraph

              To release a new version:

              1. Deploy the new version to Studio with graph deploy and a new version label. It stays private while you test it.
              2. Publish the new version from Studio or the CLI. Curators can signal on it and Indexers can index it.

              Publishing a new version costs a transaction fee. If Curators have auto-migrating signal on your Subgraph, you also fund part of the curation tax on that signal. See Curation Costs.

              To change only the metadata, such as the name, description, or image, edit your Subgraph’s details in Studio and check Update Details. This sends an onchain transaction that updates the details in Graph Explorer without publishing a new version.

              Automatic Archiving of Subgraph Versions

              When you deploy a new version of an unpublished Subgraph in Studio, the previous version is archived. Archived versions aren’t indexed, so they can’t be queried. You can unarchive a version in Studio.

              Subgraph Studio - Unarchive
              ⁠Edit on GitHub⁠

              OverviewBilling & API Keys
              On this page
              • What Users Can Do in Subgraph Studio
              • Build and Publish Subgraphs
              • Query Data via The Foundation Gateway
              • Staging in Subgraph Studio
              • Build and Deploy a Subgraph with Subgraph Studio
              • 0. Prerequisites
              • 1. Create a Subgraph in Subgraph Studio
              • 2. Install the Graph CLI
              • 3. Initialize Your Subgraph
              • 4. Build Your Subgraph
              • 5. Deploy to Subgraph Studio
              • 6. Test in Subgraph Studio
              • 7. Publish to The Graph Network
              • Update a Published Subgraph
              • Automatic Archiving of Subgraph Versions
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service