Mokhtar Naamani e952c9adc7 query-node: fix some ApiPromise specific issues in index-builder hace 4 años
..
bootstrap 835b9dc8fd remove hydra related code hace 4 años
generated 8ece43bb6f query-node: use custom index-builder-lib hace 4 años
index-builder e952c9adc7 query-node: fix some ApiPromise specific issues in index-builder hace 4 años
mappings 9b91908678 query-node: fix "happenedIn" property not defined VideoMediaEncoding graphql schema hace 4 años
.dockerignore e81df555c6 WIP - refactoring query_node hace 4 años
.env e81df555c6 WIP - refactoring query_node hace 4 años
.gitignore e952c9adc7 query-node: fix some ApiPromise specific issues in index-builder hace 4 años
README.md 2eec0339f0 update readme.md hace 4 años
docker-compose.yml 91d4a12dbb query-node: move run-tests.sh to query-node/ hace 4 años
package.json e952c9adc7 query-node: fix some ApiPromise specific issues in index-builder hace 4 años
run-tests.sh 433987200d query-node: show more log lines after tests exit hace 4 años
schema.graphql 86a14a5067 add happenedIn field to Language and VideoMediaEncoding entities hace 4 años
tsconfig.json dff8a36993 query-node: update tsconfig hace 4 años
typedefs.json ca0f390137 update typedefs from types hace 4 años

README.md

query-node

The query-node project contains an input schema (schema.graphql) and mappings for the Joystream content-directory runtime module.

Code generation

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"]
    }
}

Run mapping processor

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

Query data

Once processor start to store event data you will be able to query this data from http://localhost:4002/graphql.

query {
  channels {
    title
  }
}