Docs
खोज⌘ K
  • Home
  • The Graph के बारे में
  • समर्थित नेटवर्क
  • Protocol Contracts
  • सबग्राफ
    • सबस्ट्रीम
      • टोकन API
        • AI Suite
          • Overview
          • Indexer टूलिंग
            • GraphTally Guide
            • Supported Network Requirements
            • Chain Integration Process Overview
            • नई श्रृंखला एकीकरण
            • संसाधन
              सबग्राफ > queries > Graph Client

              @live queries in graph-client

              Graph-Client implements a custom @live directive that can make every GraphQL query work with real-time data.

              शुरू करना

              Start by adding the following configuration to your .graphclientrc.yml file:

              1plugins:2  - pollingLive:3      defaultInterval: 1000

              उपयोग

              Set the default update interval you wish to use, and then you can apply the following GraphQL @directive over your GraphQL queries:

              1query ExampleQuery @live {2  transactions(first: 2, orderBy: timestamp, orderDirection: desc) {3    id4    blockNumber5    timestamp6  }7}

              Or, you can specify a per-query interval:

              1query ExampleQuery @live(interval: 5000) {2  transactions(first: 2, orderBy: timestamp, orderDirection: desc) {3    id4  }5}

              Integrations

              Since the entire network layer (along with the @live mechanism) is implemented inside graph-client core, you can use Live queries with every GraphQL client (such as Urql or Apollo-Client), as long as it supports streame responses (AsyncIterable).

              No additional setup is required for GraphQL clients cache updates.

              ⁠GitHub पर संपादित करें⁠

              ArchitecturePython (Subgrounds)
              इस पृष्ठ पर
              • शुरू करना
              • उपयोग
              • Integrations
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service