iorveth 649082bcea Query node integration tests: hardcode delay (temporary solution) il y a 4 ans
..
bootstrap 835b9dc8fd remove hydra related code il y a 4 ans
generated 6e8b5495a2 query-node: warthog v2.20.0 il y a 4 ans
mappings 649082bcea Query node integration tests: hardcode delay (temporary solution) il y a 4 ans
.dockerignore 6c76f7d0d6 query-node: ensure building of index-builder il y a 4 ans
.env e81df555c6 WIP - refactoring query_node il y a 4 ans
.gitignore 6c76f7d0d6 query-node: ensure building of index-builder il y a 4 ans
README.md 2eec0339f0 update readme.md il y a 4 ans
docker-compose.yml 649082bcea Query node integration tests: hardcode delay (temporary solution) il y a 4 ans
package.json 569f470806 query-node: use @dzlzv/hydra-indexer-lib@0.0.18-legacy.1.26.1 il y a 4 ans
run-tests.sh c95bc9ff31 query-node: test runner fix passing WS_PROVIDER_ENDPOINT_URI env variable il y a 4 ans
schema.graphql 86a14a5067 add happenedIn field to Language and VideoMediaEncoding entities il y a 4 ans
tsconfig.json dff8a36993 query-node: update tsconfig il y a 4 ans
typedefs.json ca0f390137 update typedefs from types il y a 4 ans

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