Consentimiento de cookies

Al continuar usando este sitio, aceptas el uso de cookies de acuerdo con nuestra Política de privacidad.

Docs
Buscar⌘ K
  • Inicio
  • Acerca de The Graph
  • Redes Admitidas
  • Protocol Contracts
  • Subgrafos
    • Comienzo Rapido
    • Graph Explorer
    • Querying
      • Introducción
      • Managing API keys
      • Mejores Prácticas para Consultas
      • Querying from an App
      • Sistemas Distribuidos
      • API GraphQL
      • Subgraph ID vs Deployment ID
      • Graph Client
        • Python (Subgrounds)
      • Developing
        • Facturación
        • How-to Guides
          • Best Practices
            • Fair Use Policy
            • Upgrade Indexer
          • Corrientes secundarias
            • Token API
              • AI Suite
                • Indexación
                  • Recursos
                    Subgrafos > Querying

                    2 minutos

                    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, 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:

                    Deployment ID

                    The Deployment ID is the IPFS hash of the compiled manifest file, which refers to other files on IPFS instead of relative URLs on the computer. For example, the compiled manifest can be accessed via: https://ipfs.thegraph.com/ipfs/QmQKXcNQQRdUvNRMGJiE2idoTu9fo5F5MRtKztH4WyKxED. To change the Deployment ID, one can simply update the manifest file, such as modifying the description field as described in the Subgraph manifest documentation⁠.

                    When queries are made using a Subgraph’s Deployment ID, we are specifying a version of that Subgraph to query. Using the Deployment ID to query a specific Subgraph version results in a more sophisticated and robust setup as there is full control over the Subgraph version being queried. However, this results in the need of updating the query code manually every time a new version of the Subgraph is published.

                    Example endpoint that uses Deployment ID:

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

                    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.

                    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

                    ⁠Editar en GitHub⁠

                    API GraphQLIntroducción
                    En esta página
                    • Deployment ID
                    • Subgraph ID
                    The GraphEstadoTestnetRecursos de marcaForoSeguridadPolítica de privacidadTérminos de servicio
                    English
                    العربية
                    Čeština
                    Deutsch
                    Español
                    Français
                    हिन्दी
                    Italiano
                    日本語
                    मराठी
                    Português
                    Русский
                    Svenska
                    Türkçe
                    اردو
                    中文