|
4 سال پیش | |
---|---|---|
.. | ||
bootstrap | 4 سال پیش | |
generated | 4 سال پیش | |
index-builder | 4 سال پیش | |
mappings | 4 سال پیش | |
.dockerignore | 4 سال پیش | |
.env | 4 سال پیش | |
.gitignore | 4 سال پیش | |
README.md | 4 سال پیش | |
docker-compose.yml | 4 سال پیش | |
package.json | 4 سال پیش | |
run-tests.sh | 4 سال پیش | |
schema.graphql | 4 سال پیش | |
tsconfig.json | 4 سال پیش | |
typedefs.json | 4 سال پیش |
The query-node project contains an input schema (schema.graphql) and mappings for the Joystream content-directory
runtime module.
We use Hydra-cli to generate a graphql server and a block indexer for joystream chain:
$ cd query-node
$ hydra-cli codegen
After codegen process is done, we must add this lines to the indexer/tsconfig.json
file. It is required because we are using joystream/types
for decoding chain data in the mappings:
{
"compilerOptions":
...
"baseUrl": ".",
"paths": {
"@polkadot/types/augment": ["../../node_modules/@joystream/types/augment-codec/augment-types.ts"]
}
}
Before running mappings make sure indexer(yarn indexer:start
) and indexer-api-server (mappings get the chain data from this graphql server) are both running:
yarn processor:start
Once processor start to store event data you will be able to query this data from http://localhost:4002/graphql
.
query {
channels {
title
}
}