Joystream Stats 1e81c42be3 use host pg service from docker containers (olympia) | 2 лет назад | |
---|---|---|
.. | ||
codegen | 2 лет назад | |
mappings | 2 лет назад | |
schemas | 2 лет назад | |
.gitignore | 2 лет назад | |
CHANGELOG.md | 2 лет назад | |
README.md | 2 лет назад | |
build.sh | 2 лет назад | |
kill.sh | 2 лет назад | |
manifest.yml | 2 лет назад | |
package.json | 2 лет назад | |
run-tests.sh | 2 лет назад | |
start.sh | 2 лет назад |
This is a query-node project generated by hydra-cli
. Experiment by modifying schema.graphql
and the mappings in the mappings
folder, defined in manifest.yml
.
For more information about Hydra see: https://dzhelezov.gitbook.io/hydra/
Run
# Make sure these steps are executed first:
# yarn build:packages; # OR:
# yarn && yarn workspace @joystream/types build && yarn workspace @joystream/metadata-protobuf build
yarn workspace query-node-root build
This will generate event decorations for the mappings via hydra-typegen
inside mappings/generated
(based on the runtime metadata saved in ../chain-metadata.json
) and a graphql-server along with the TypeORM models based on schema.graphql
inside generated/graphql-server
.
In order to re-build the mappings only, without re-generating the graphql-server code and event decorations (in case there were no changes in the runtime and schema.graphql
) you can also run:
yarn workspace query-node-mappings build
yarn workspace query-node-root start
This script script will:
joystream-node
service (if not already started)db
service (query node is using a PostgreSQL database to store the data)yarn workspace query-node config:dev
)yarn workspace query-node-root db:prepare && yarn workspace query-node-root db:processor:migrate
)docker-compose up -d graphql-server
)docker-compose up -d processor
)You can stop the query-node and remove all associated docker containers without affecting any other services by running:
yarn workspace query-node-root kill
Follow the links for more information about the indexer service and indexer-api-gateway.
Query node's user interface, GraphQL Playground, is expecting to be served at /graphql
.
If you are serving the files on path like /query/server/graphql
via some nginx proxy, aliasing, etc. you will need to provide
the base url to query node server via GRAPHQL_PLAYGROUND_CDN
environment variable.
# use the following when serving playground at `/query/server/graphql`
GRAPHQL_PLAYGROUND_CDN="query/server" yarn workspace query-node-root query-node:start:dev