Mokhtar Naamani 0e590e9387 query-node: configure WS_PROVIDER_ENDPOINT_URI in docker-compose file há 4 anos atrás
..
bootstrap 835b9dc8fd remove hydra related code há 4 anos atrás
generated 8ece43bb6f query-node: use custom index-builder-lib há 4 anos atrás
index-builder 60e19640fa index-builder: strange build error '@ts-ignore'ing for now há 4 anos atrás
mappings 9b91908678 query-node: fix "happenedIn" property not defined VideoMediaEncoding graphql schema há 4 anos atrás
.dockerignore 6c76f7d0d6 query-node: ensure building of index-builder há 4 anos atrás
.env e81df555c6 WIP - refactoring query_node há 4 anos atrás
.gitignore 6c76f7d0d6 query-node: ensure building of index-builder há 4 anos atrás
README.md 2eec0339f0 update readme.md há 4 anos atrás
docker-compose.yml 0e590e9387 query-node: configure WS_PROVIDER_ENDPOINT_URI in docker-compose file há 4 anos atrás
package.json 5f27cd5e62 query-node: do not do postinstall in query-node its running before @joystream/types get built há 4 anos atrás
run-tests.sh 0e590e9387 query-node: configure WS_PROVIDER_ENDPOINT_URI in docker-compose file há 4 anos atrás
schema.graphql 86a14a5067 add happenedIn field to Language and VideoMediaEncoding entities há 4 anos atrás
tsconfig.json dff8a36993 query-node: update tsconfig há 4 anos atrás
typedefs.json ca0f390137 update typedefs from types há 4 anos atrás

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