litentry-graph/subschemas/substrate-api-proxy at main · litentry/litentry-graph
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.
To build the code, just run:
If you need to watch for changes on the code, for building on the fly, run:
Regenerate Types for Resolvers
In order to generate the type definitions in the project, you need to run:
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.