GraphQL Query Engine
To make DeepBlock’s data easily accessible, we provide a GraphQL query engine on top of the knowledge graph. GraphQL is a flexible query language that lets clients request exactly the data they need, and DeepBlock’s schema is designed to expose the richness of the underlying graph.
Unified Schema
We define a schema that covers the major entities and relations in the knowledge graph. For example, you might have types like Address
, Transaction
, Token
, Protocol
, etc., each with fields that link to other types. An Address
type might have fields like transactions(sent: Boolean)
to retrieve its transactions, balances
to get token balances, interactions
to get related addresses, and so on. The schema abstracts away the complexity of the backend graph queries – you can think in terms of DeFi concepts.
Cross-Chain Queries
The GraphQL API supports specifying networks or querying across networks. For instance, a query could fetch an address’s transactions and you could include a filter like network: ETHEREUM
or network: POLYGON
. We also provide unified fields for cross-chain queries when relevant. In practice, this means you don’t have to hit separate APIs for each chain – one query can pull data from multiple blockchains at once, stitched together by DeepBlock.
Granular Queries (No Over-Fetching)
With GraphQL, you ask for exactly what you want. For example, if you need the latest 5 transactions of a particular address with the counterparty addresses and token amounts, you can retrieve all that in one query. No need to manually combine responses from different endpoints. This efficiency saves bandwidth and time. One intelligent query might replace dozens of calls to a traditional API or many lines of custom parsing code.
Optimized and Cached
Under the hood, the GraphQL engine translates your query into the most efficient traversal of the knowledge graph. We employ caching strategies for frequently accessed data (for example, common aggregation results or popular endpoints) – this is part of the Performance Layer. If you request something that has been recently computed (and the underlying data hasn’t changed), DeepBlock can return it very quickly from cache. We also use smart query planners so that even if a query spans large portions of the graph, it tries to minimize work (for instance, stopping early once the query conditions are satisfied, or only exploring relevant subgraphs based on filters).
Pagination & Limits
For very large result sets, the GraphQL API supports pagination (cursor-based or offset-based, depending on the field). This means if you query something like all transactions in a year (which could be millions of entries), the API will return a manageable page of results with a pointer to fetch the next page. There are also sensible rate limits in place to ensure stability (documented in the API guide), but enterprise users can request higher limits or use our export features.
In summary, the GraphQL query engine is your gateway to DeepBlock’s data. It offers the flexibility of a custom query language with the ease-of-use of a single endpoint.
Developers can integrate it into their applications, analysts can use it to pull exactly the data they need for modeling, and AI agents can leverage it to gather facts during their reasoning process. All of this happens with low latency, thanks to the performance optimizations in place.
Last updated