Skip to content

Commit bafc80e

Browse files
Katara subgraph vs deployment (#955)
* Initial draft * Fix
1 parent 82b8130 commit bafc80e

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

website/src/pages/en/subgraphs/querying/subgraph-id-vs-deployment-id.mdx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
title: Subgraph ID vs Deployment ID
33
---
44

5+
Managing and accessing Subgraphs relies on two distinct identification systems: Subgraph IDs and Deployment IDs.
6+
57
A Subgraph is identified by a Subgraph ID, and each version of the Subgraph is identified by a Deployment ID.
68

79
When querying a Subgraph, either ID can be used, though it is generally suggested that the Deployment ID is used due to its ability to specify a specific version of a Subgraph.
810

9-
Here are some key differences between the two IDs: ![](/img/subgraph-id-vs-deployment-id.png)
11+
Both identifiers are accessible in [Subgraph Studio](https://thegraph.com/studio/):
12+
13+
![Highlights of where to find the Subgraph ID and Deployment ID](/img/subgraph-id-vs-deployment-id.png)
1014

1115
## Deployment ID
1216

@@ -18,10 +22,33 @@ Example endpoint that uses Deployment ID:
1822

1923
`https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmfYaVdSSekUeK6expfm47tP8adg3NNdEGnVExqswsSwaB`
2024

25+
Using Deployment IDs for queries offers precise version control but comes with specific implications:
26+
27+
- Advantages: Complete control over which version you're querying, ensuring consistent results
28+
- Challenges: Requires manual updates to query code when new Subgraph versions are published
29+
- Use case: Ideal for production environments where stability and predictability are crucial
30+
2131
## Subgraph ID
2232

2333
The Subgraph ID is a unique identifier for a Subgraph. It remains constant across all versions of a Subgraph. It is recommended to use the Subgraph ID to query the latest version of a Subgraph, although there are some caveats.
2434

2535
Be aware that querying using Subgraph ID may result in queries being responded to by an older version of the Subgraph due to the new version needing time to sync. Also, new versions could introduce breaking schema changes.
2636

2737
Example endpoint that uses Subgraph ID: `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/FL3ePDCBbShPvfRJTaSCNnehiqxsPHzpLud6CpbHoeKW`
38+
39+
Using Subgraph IDs comes with important considerations:
40+
41+
- Benefits: Automatically queries the latest version, reducing maintenance overhead
42+
- Limitations: May encounter version synchronization delays or breaking schema changes
43+
- Use case: Better suited for development environments or when staying current is more important than version stability
44+
45+
## Deployment ID vs Subgraph ID
46+
47+
Here are the key differences between the two IDs:
48+
49+
| Consideration | Deployment ID | Subgraph ID |
50+
| ----------------------- | --------------------- | --------------- |
51+
| Version Pinning | Specific version | Always latest |
52+
| Maintenance Effort | High (manual updates) | Low (automatic) |
53+
| Environment Suitability | Production | Development |
54+
| Sync Status Awareness | Not required | Critical |

0 commit comments

Comments
 (0)