SubQuery powers the next generation of Polkadot dApps by allowing developers to extract, transform and query blockchain data in real time using GraphQL. In addition to this, SubQuery provides production quality hosting infrastructure to run these projects in.
This subquery example indexes the amount transferred of each account and it is an example of a 1-many entity relationshp. In other words, one account can have many receiving addresses.
git clone https://github.com/subquery/tutorials-account-transfers.git
cd <folder>
yarn
yarn codegen
yarn build
docker-compose pull & docker-compose up
Open http://localhost:3000/ on your browser
query{
transfers(first: 3){
nodes{
id
amount
blockNumber
to{
id
}
}
}
}