diff --git a/website/src/pages/en/subgraphs/querying/subgraph-id-vs-deployment-id.mdx b/website/src/pages/en/subgraphs/querying/subgraph-id-vs-deployment-id.mdx index 17258dd13ea1..59d5d230449e 100644 --- a/website/src/pages/en/subgraphs/querying/subgraph-id-vs-deployment-id.mdx +++ b/website/src/pages/en/subgraphs/querying/subgraph-id-vs-deployment-id.mdx @@ -2,11 +2,15 @@ title: Subgraph ID vs Deployment ID --- +Managing and accessing Subgraphs relies on two distinct identification systems: Subgraph IDs and Deployment IDs. + A Subgraph is identified by a Subgraph ID, and each version of the Subgraph is identified by a Deployment ID. 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. -Here are some key differences between the two IDs: ![](/img/subgraph-id-vs-deployment-id.png) +Both identifiers are accessible in [Subgraph Studio](https://thegraph.com/studio/): + +![Highlights of where to find the Subgraph ID and Deployment ID](/img/subgraph-id-vs-deployment-id.png) ## Deployment ID @@ -18,6 +22,12 @@ Example endpoint that uses Deployment ID: `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmfYaVdSSekUeK6expfm47tP8adg3NNdEGnVExqswsSwaB` +Using Deployment IDs for queries offers precise version control but comes with specific implications: + +- Advantages: Complete control over which version you're querying, ensuring consistent results +- Challenges: Requires manual updates to query code when new Subgraph versions are published +- Use case: Ideal for production environments where stability and predictability are crucial + ## Subgraph ID 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. @@ -25,3 +35,20 @@ The Subgraph ID is a unique identifier for a Subgraph. It remains constant acros 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. Example endpoint that uses Subgraph ID: `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/FL3ePDCBbShPvfRJTaSCNnehiqxsPHzpLud6CpbHoeKW` + +Using Subgraph IDs comes with important considerations: + +- Benefits: Automatically queries the latest version, reducing maintenance overhead +- Limitations: May encounter version synchronization delays or breaking schema changes +- Use case: Better suited for development environments or when staying current is more important than version stability + +## Deployment ID vs Subgraph ID + +Here are the key differences between the two IDs: + +| Consideration | Deployment ID | Subgraph ID | +| ----------------------- | --------------------- | --------------- | +| Version Pinning | Specific version | Always latest | +| Maintenance Effort | High (manual updates) | Low (automatic) | +| Environment Suitability | Production | Development | +| Sync Status Awareness | Not required | Critical |