
{"id":131196,"date":"2026-01-30T13:34:47","date_gmt":"2026-01-30T13:34:47","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=131196"},"modified":"2026-01-30T13:34:47","modified_gmt":"2026-01-30T13:34:47","slug":"the-graph-how-blockchain-apps-query-data-without-running-nodes","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=131196","title":{"rendered":"The Graph: How Blockchain Apps Query Data Without Running Nodes"},"content":{"rendered":"<p>The Graph<\/p>\n<p>I had a question last week that stopped me in my\u00a0tracks.<\/p>\n<p>I was looking at Uniswap\u2019s interface, and I noticed it showed my complete trade history instantly. Every swap I\u2019d ever made. Across multiple chains. In milliseconds. I thought: \u201cHow does this\u00a0work?\u201d<\/p>\n<p>The blockchain doesn\u2019t have a \u201cSELECT * FROM trades WHERE user = 0xRibhav\u201d function. You can\u2019t query Ethereum like a SQL database.<\/p>\n<p>So how does Uniswap know what I\u2019ve traded? How does OpenSea instantly show me all my NFTs across 10 different chains?<\/p>\n<p>The answer: <strong>indexing<\/strong>.<\/p>\n<p>This is Day 34 of the 60\u2011Day Web3 journey, still in <strong>Phase 3: Development<\/strong>. Today we\u2019re talking about The Graph, blockchain indexers, and why every dApp you use depends on infrastructure you probably don\u2019t think\u00a0about.<\/p>\n<h3>The Problem: Blockchains Are Terrible Databases<\/h3>\n<p>Here\u2019s what I learned the hard\u00a0way.<\/p>\n<p>Blockchains are amazing at recording transactions, proving ownership, and executing logic. They\u2019re terrible at answering questions like:<\/p>\n<p>\u201cShow me all NFT transfers for address\u00a00xABC\u201d\u201cWhat\u2019s the total trading volume on Uniswap\u00a0today?\u201d\u201cWhich wallets hold more than 1000 of this\u00a0token?\u201d<\/p>\n<p>Why?<\/p>\n<p>Because blockchains don\u2019t store data in a queryable format. They store it as a chain of blocks, each containing a list of transactions. To answer \u201cshow me all NFT transfers,\u201d you\u2019d have\u00a0to:<\/p>\n<p>Download the entire blockchain (hundreds of gigabytes)Run a full node (expensive and\u00a0slow)Scan every single block from genesis to\u00a0nowParse every transactionFilter for NFT transfersFilter for your specific\u00a0addressBuild your own database to cache\u00a0results<\/p>\n<p>For Ethereum\u2019s 18+ million blocks, this could take hours or days. And you\u2019d have to do it every time you wanted updated data. That\u2019s not a product. That\u2019s infrastructure hell.<\/p>\n<h3>What Indexers Actually\u00a0Do<\/h3>\n<p>Indexers solve this by doing the boring work once, for everyone.<\/p>\n<p>They:<\/p>\n<p>Run full blockchain nodesListen for new blocks in real-timeParse every transaction and\u00a0eventStore the data in a queryable database (like PostgreSQL or\u00a0GraphQL)Expose APIs so dApps can query instantly<\/p>\n<p>Instead of every dApp running its own node and parsing data, they just query the indexer\u2019s API.<\/p>\n<p>Think of it like Google for blockchains. Google crawls billions of web pages and indexes them. You don\u2019t have to visit every website manually to find what you need. You just\u00a0search.<\/p>\n<p>Indexers do the same thing for blockchain data.<\/p>\n<h3>The Graph: The Google of Blockchain Data<\/h3>\n<p>The Graph is the most popular blockchain indexer.<\/p>\n<p>Launched in 2020, it\u2019s now used by over 3,000 dApps, including:<\/p>\n<p>Uniswap (trade history, liquidity data)Aave (lending\/borrowing stats)OpenSea (NFT ownership and transfers)Decentraland (virtual land ownership)<\/p>\n<p>Here\u2019s how it\u00a0works:<\/p>\n<p><strong>1. Subgraphs<\/strong><br \/>Developers create \u201csubgraphs\u201d\u200a\u2014\u200abasically, instructions for what data to index and how to organize\u00a0it.<\/p>\n<p>A subgraph says: \u201cListen to this smart contract. When it emits an event, save these fields to the database.\u201d<\/p>\n<p><strong>2. Indexers<\/strong><br \/>Indexers (node operators) run The Graph\u2019s software and process subgraphs. They\u2019re paid in GRT tokens to keep data up-to-date.<\/p>\n<p><strong>3. Query API<\/strong><br \/>dApps query the indexed data using GraphQL (a query language, like SQL but for\u00a0APIs).<\/p>\n<p><strong>Example query:<\/strong><\/p>\n<p>{<br \/>  user(id: &#8220;0xRibhav&#8221;) {<br \/>    swaps {<br \/>      amountIn<br \/>      amountOut<br \/>      timestamp<br \/>    }<br \/>  }<br \/>}<\/p>\n<p>This returns all my Uniswap swaps in milliseconds. No node. No blockchain scanning. Just a clean API response.<\/p>\n<h3>Real Example: How Uniswap Uses The\u00a0Graph<\/h3>\n<p>When you open Uniswap and see your trade history, here\u2019s what happens behind the\u00a0scenes:<\/p>\n<p><strong>Your browser<\/strong> sends a GraphQL query to The Graph\u2019s\u00a0API<strong>The Graph<\/strong> looks up your address in its indexed\u00a0database<strong>It returns<\/strong> all your swaps, formatted as\u00a0JSON<strong>Uniswap\u2019s frontend<\/strong> displays it in the\u00a0UI<\/p>\n<p>All of this happens in under 100 milliseconds.<\/p>\n<p>Without The Graph, Uniswap would have\u00a0to:<\/p>\n<p>Run multiple Ethereum nodes (one per chain they\u00a0support)Parse every block for swap\u00a0eventsBuild and maintain their own\u00a0databaseHandle scaling as usage\u00a0grows<\/p>\n<p>The Graph handles all of this. Uniswap just queries an\u00a0API.<\/p>\n<h3>How The Graph Actually Works (Under the\u00a0Hood)<\/h3>\n<p>I spent some time digging into this because I wanted to understand what\u2019s happening when I query\u00a0data.<\/p>\n<p><strong>Step 1: A smart contract emits an\u00a0event<\/strong><\/p>\n<p>When you swap on Uniswap, the smart contract emits a Swap\u00a0event:<\/p>\n<p>event Swap(<br \/>    address indexed sender,<br \/>    uint amount0In,<br \/>    uint amount1In,<br \/>    uint amount0Out,<br \/>    uint amount1Out,<br \/>    address indexed to<br \/>);<\/p>\n<p><strong>Step 2: The Graph\u2019s indexer is listening<\/strong><\/p>\n<p>A subgraph has been created for Uniswap. It listens for this Swap event and says: &#8220;When this happens, save the sender, amounts, and timestamp to the database.&#8221;<\/p>\n<p><strong>Step 3: Data gets\u00a0stored<\/strong><\/p>\n<p>The indexer processes the event and writes it to a structured database.<\/p>\n<p><strong>Step 4: You query\u00a0it<\/strong><\/p>\n<p>When you open Uniswap, your browser sends a GraphQL query asking for all swaps where sender = your\u00a0address.<\/p>\n<p>The Graph returns the data instantly because it\u2019s already\u00a0indexed.<\/p>\n<h3>Why This Matters More in\u00a02026<\/h3>\n<p>Indexing used to be a \u201cnice to have.\u201d In 2026, it\u2019s critical infrastructure.<\/p>\n<p>Here\u2019s why:<\/p>\n<p><strong>1. Multi-chain is the\u00a0norm<\/strong><\/p>\n<p>dApps now support 5, 10, or 20+ chains. Running full nodes for every chain is impossible for most teams.<br \/>Indexers aggregate data across all chains in one\u00a0API.<\/p>\n<p><strong>2. Real-time data is\u00a0expected<\/strong><\/p>\n<p>Users expect instant load times. No one waits 30 seconds for their NFT portfolio to load.<br \/>Indexers make this possible.<\/p>\n<p><strong>3. Complex queries are\u00a0common<\/strong><\/p>\n<p>Modern dApps need to answer questions like:<\/p>\n<p>\u201cWhat\u2019s the 30-day trading volume of this liquidity pool?\u201d\u201cShow me all governance proposals this DAO voted\u00a0on\u201d\u201cWhich wallets bought this NFT in the past\u00a0week?\u201d<\/p>\n<p>Without indexers, these queries are painful to\u00a0build.<\/p>\n<p><strong>4. Cost\u00a0savings<\/strong><\/p>\n<p>Running your own indexing infrastructure costs thousands per month. Using The Graph costs a few dollars per million queries. For most teams, it\u2019s a no-brainer.<\/p>\n<h3>The Competition: Indexers in\u00a02026<\/h3>\n<p>The Graph isn\u2019t the only player anymore. In 2026, several alternatives have\u00a0emerged:<\/p>\n<h3>Subsquid<\/h3>\n<p>Open-source indexerClaims to be 10x faster than The\u00a0GraphBetter for high-frequency data (like\u00a0DeFi)<\/p>\n<h3>Ponder<\/h3>\n<p>Built for TypeScript developersSimpler setup than The\u00a0GraphGreat for indie\u00a0builders<\/p>\n<h3>Goldsky<\/h3>\n<p>Enterprise-focusedReal-time streaming dataUsed by large protocols with high\u00a0traffic<\/p>\n<h3>Dune Analytics<\/h3>\n<p>SQL-based queries (familiar for data analysts)Great for dashboards and analyticsNot as good for real-time dApp frontends<\/p>\n<p><strong>The trend:<\/strong> More options, more competition, better performance.<\/p>\n<h3>When You Should (and Shouldn\u2019t) Use\u00a0Indexers<\/h3>\n<p><strong>Use an indexer\u00a0when:<\/strong><\/p>\n<p>You need historical data (trade history, NFT transfers)You\u2019re building a multi-chain appYou want to avoid running infrastructureYou need complex queries (aggregations, filters,\u00a0joins)<\/p>\n<p><strong>Don\u2019t use an indexer\u00a0when:<\/strong><\/p>\n<p>You only need real-time data (current price, latest\u00a0block)You\u2019re querying a single, simple contract state (like a\u00a0balance)You\u2019re okay running your own\u00a0node<\/p>\n<p>For most dApps, the answer is: use an\u00a0indexer.<\/p>\n<h3>What I Learned Building With The\u00a0Graph<\/h3>\n<p>I tried building a simple subgraph last week for a test NFT contract.<\/p>\n<p>Here\u2019s what I\u00a0learned:<\/p>\n<p><strong>1. GraphQL is easy if you know SQL<\/strong><br \/>The query syntax is intuitive. If you\u2019ve ever written SELECT * FROM table, you&#8217;ll pick up GraphQL\u00a0fast.<\/p>\n<p><strong>2. Subgraph creation has a learning curve<\/strong><br \/>You need to write a schema (what data to store) and mappings (how to process events). It\u2019s not hard, but it takes a few tries to get\u00a0right.<\/p>\n<p><strong>3. Deployment is instant<\/strong><br \/>Once you deploy a subgraph, it starts indexing within minutes. Queries work immediately.<\/p>\n<p><strong>4. The hosted service is being phased out<\/strong><br \/>The Graph is moving to a fully decentralized network. You\u2019ll need GRT tokens to query data in production.<\/p>\n<p><strong>5. Alternatives are worth exploring<\/strong><br \/>If you\u2019re building something new, check out Subsquid or Ponder. They\u2019re easier to set up for small projects.<\/p>\n<h3>Key Takeaway<\/h3>\n<p>Blockchains are permanent ledgers, not databases.<\/p>\n<p>When you see a dApp load your trade history, portfolio, or NFT collection instantly, there\u2019s an indexer working behind the\u00a0scenes.<\/p>\n<p>The Graph is the most popular, but it\u2019s not the only option anymore. In 2026, indexing infrastructure is mature, competitive, and critical to every Web3\u00a0app.<\/p>\n<p>If you\u2019re building anything that needs to query blockchain data, you\u2019re not running your own node. You\u2019re using an\u00a0indexer.<\/p>\n<p>That\u2019s the invisible layer that makes Web3 feel\u00a0fast.<\/p>\n<h3>What\u2019s Coming\u00a0Next<\/h3>\n<p>Today we learned that blockchains can\u2019t answer questions efficiently, and indexers solve that\u00a0problem.<\/p>\n<p>Tomorrow, we shift gears completely. You\u2019ve learned to write contracts, test them, analyze security, and understand infrastructure.<\/p>\n<p>But what about actually deploying to mainnet? (There\u2019s no \u201cundo\u201d button on Ethereum)<\/p>\n<h3>Resources to Go\u00a0Deeper<\/h3>\n<p><a href=\"https:\/\/thegraph.com\/docs\"><strong>The Graph Documentation<\/strong><\/a>\u00a0: Official guide to building and deploying subgraphs.<a href=\"https:\/\/docs.subsquid.io\/\"><strong>Subsquid Docs<\/strong><\/a>\u00a0: Faster alternative to The Graph, open-source indexer.<a href=\"https:\/\/ponder.sh\/\"><strong>Ponder<\/strong><\/a>\u00a0: TypeScript-native indexer for indie builders.<a href=\"https:\/\/thegraph.com\/explorer\/subgraphs\/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu\"><strong>Uniswap Subgraph<\/strong><\/a>\u00a0: Real-world example of how Uniswap indexes\u00a0data.<\/p>\n<p>Follow the series on <a href=\"https:\/\/medium.com\/@Ribhavmodi\">Medium<\/a> | <a href=\"https:\/\/x.com\/RibsModi\">Twitter<\/a> |\u00a0<a href=\"https:\/\/future.forem.com\/ribhavmodi\/\">Future<\/a><\/p>\n<p>Jump into <a href=\"https:\/\/t.me\/Web3ForHumans\">Web3ForHumans<\/a> on Telegram and let\u2019s learn together.<\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/the-graph-how-blockchain-apps-query-data-without-running-nodes-69bc83a9a6d3\">The Graph: How Blockchain Apps Query Data Without Running Nodes<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>The Graph I had a question last week that stopped me in my\u00a0tracks. I was looking at Uniswap\u2019s interface, and I noticed it showed my complete trade history instantly. Every swap I\u2019d ever made. Across multiple chains. In milliseconds. I thought: \u201cHow does this\u00a0work?\u201d The blockchain doesn\u2019t have a \u201cSELECT * FROM trades WHERE user [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":131197,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-131196","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/131196"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131196"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/131196\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/media\/131197"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}