Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Latest commit

 

History

History

entity-relation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

What is SubQuery?

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.

SubQuery Example - Entity relations

This subquery indexes balance transfers between accounts, it is designed to demonstrate the many-to-many relationship within these entities.

This subquery also indexes the utility batchAll calls which are formated in tree structure, and we established an one-to-many relationship within those entities, allow us to understand the actual actions of this extrinsic and know its position in the tree.

Getting Started

1. Clone the entire subql-example repository

git clone https://github.com/subquery/subql-examples.git

2. Install dependencies

cd entity-relation
# Yarn
yarn

#NPM
npm install

3. Generate types

#Yarn
yarn codegen

#NPM
npm run-script codegen

4. Build the project

#Yarn
yarn build

#NPM
npm run-script build

5. Run locally

#Yarn
yarn start:docker

#NPM
npm run start:docker

6. Example queries to run

{
  query{
    transfers{
      nodes{
        amount
      }
    }
  }
}