Polkadot API

Repository

litentry-graph/subschemas/substrate-api-proxy at main · litentry/litentry-graph
GitHub

Overview

This component of the Litentry Graph is the one that queries data directly from the blockchain nodes, using the Polkadot API.
The data obtained is then structured and mapped accordingly and exposed in the proper APIs we create. This means that several elements of the blockchain can be aggregated and manipulated into one exposed API.

Getting Started

Development

To build the code, just run:
cd subschemas/substrate-api-proxy
yarn build
If you need to watch for changes on the code, for building on the fly, run:
cd subschemas/substrate-api-proxy
yarn watch

Regenerate Types for Resolvers

In order to generate the type definitions in the project, you need to run:
cd subschemas/substrate-api-proxy
yarn codegen

How to create a new API

First, you'll need to create a new type inside subschemas/substrate-api-proxy/typeDefs. Once you have created this, run the codegen command in Regenerate Types for Resolvers.
Add your API to subschemas/substrate-api-proxy/resolvers/Query in a similar fashion as the other resolvers.
Then just Build and Run, testing in the client of your choice.
Copy link
On this page
Repository
Overview
Getting Started
How to create a new API