Skip to content

Commit

Permalink
New translations querying-by-subgraph-id-vs-deployment-id.mdx (Korean)
Browse files Browse the repository at this point in the history
  • Loading branch information
benface committed Jan 9, 2024
1 parent 2890562 commit ca48e5f
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Subgraph ID vs Deployment ID
---

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. However, there are some important differences between the two options.

![](/img/subgraph-id-vs-deployment-id.png)

## Subgraph ID

The Subgraph ID is a unique identifier for a subgraph. It remains constant across all versions of a subgraph. When queries are made using the Subgraph ID, you are not specifying a version. This means that the version of the subgraph that responds to your query may not be the latest version. Rather, it will be the most recent version that is synced and healthy.

Example endpoint that uses Subgraph ID:

`https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/FL3ePDCBbShPvfRJTaSCNnehiqxsPHzpLud6CpbHoeKW`

## Deployment ID

When you're viewing a deployed subgraph, previously deployed versions are available for selection. Each version in that list has a unique Deployment ID.

When you make queries using the Deployment ID, you are specifying a version of that subgraph to query. This means that the version of the subgraph that responds to your query will be the version specified by the Deployment ID.

Example endpoint that uses Deployment ID:

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

## Considerations When Using Subgraph ID vs Deployment ID

If you want to ensure that the latest version of your subgraph responds to your queries, you should use the Deployment ID. This requires you to update the Deployment ID in your frontend whenever you publish a new version of your subgraph.

If you want to ensure you are querying a specific version of your subgraph, you should also use Deployment ID.

If you do not need to ensure that the latest version of your subgraph always responds to your queries, you can use the Subgraph ID. However, be aware that this may result in your queries being responded to by an older version of your subgraph.

0 comments on commit ca48e5f

Please sign in to comment.