GraphQL-based data indexing and querying across all Lux chains. Schema management, cross-chain federation, subscriptions, and automatic indexing with DGraph.
The Graph Chain provides a decentralized data indexing and query layer for all Lux chains. Using GraphQL as the query language and DGraph as the storage backend, G-Chain enables efficient cross-chain data federation.
Developers define schemas and indexing rules, and G-Chain validators automatically index blockchain data as it's produced. Subscriptions provide real-time updates, and cross-chain federation allows queries that span multiple Lux chains in a single request.
G-Chain eliminates the need for custom indexing infrastructure. Any dApp can query historical and real-time blockchain data through a standard GraphQL endpoint.
Quick start using the Lux JavaScript SDK.
import { GraphClient } from 'luxnet/graph'
const graph = new GraphClient('https://graph.lux.network')
// Query cross-chain data
const result = await graph.query(`{
transfers(chain: "C", first: 10) {
from
to
amount
block { number timestamp }
}
}`)