Atlas quickstart
You need an Atlas workspace and project, Graph CLI, and a subgraph that builds with graph build.
1. Create a deployment key
In the Atlas console, open Keys and create a deployment key for your project. Deployment keys start with atlas_dk_. Keep the key secret and export it in your terminal:
export ATLAS_DEPLOY_KEY=atlas_dk_...2. Create the subgraph
Create the subgraph in the console, or with Graph CLI:
graph create my-subgraph \
--node https://deploy.atlas.thymelabs.io \
--access-token "$ATLAS_DEPLOY_KEY"A deploy to a name that doesn't exist yet fails with Create this subgraph in Atlas or with graph create first.
3. Deploy
Run these from your subgraph directory. Keep the --headers flag: it authenticates the artifact uploads with the same key.
graph codegen
graph build
graph deploy my-subgraph \
--node https://deploy.atlas.thymelabs.io \
--ipfs https://ipfs.atlas.thymelabs.io/api/v0 \
--deploy-key "$ATLAS_DEPLOY_KEY" \
--headers "{\"Authorization\":\"Bearer $ATLAS_DEPLOY_KEY\"}" \
--version-label v1Your manifest selects the network. Each version label is immutable, so use a new label for every deploy. If Atlas rejects the manifest, the error names the rule, for example the supported networks.
4. Promote the release
Open the subgraph in the console and wait for the release to finish syncing. Then promote it to production. The subgraph URL serves the production release. Until you promote one, query a release by its version URL instead (see queries).
5. Query
Create a query key on the Keys page (it starts with atlas_qk_) and send a request:
curl https://query.atlas.thymelabs.io/subgraphs/<subgraph-id> \
-H "Authorization: Bearer $ATLAS_QUERY_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"{ _meta { block { number } } }"}'The subgraph ID is shown in the console and in the URL Graph CLI prints after a deploy. A query key used from a browser is visible to everyone, so restrict it to your origins.
Import from The Graph
To copy a deployment that is already published on The Graph, use Import from The Graph when creating a subgraph. Atlas fetches the deployment's files by ID and indexes them unchanged, subject to the same manifest rules.