Graphql-engine: Need example for `hasura console --static-dir <path>`

Created on 19 Nov 2019  路  5Comments  路  Source: hasura/graphql-engine

Hi,

In #521, @shahidhk commented that we could get the CLI console to serve static files while offline by running hasura console --static-dir <path>. I've been trying to use that but can't figure out a correct path value.

Is this approach still valid? Would you mind providing an example path?

Thanks!

question

All 5 comments

Thanks @rikinsk.

So I had seen this and my setup is based on it. I have the following in my hasura engine config

- name: HASURA_GRAPHQL_CONSOLE_ASSETS_DIR
  value: /srv/console-assets

and I open the console with

hasura console --static-dir "/console/assets"

What am I getting wrong?

@tibotiber --static-dir for the Hasura CLI refers to a local directory where console assets are present. You can get these assets by cloning the graphql engine repo and building the console yourself.

cd ~
git clone https://github.com/hasura/graphql-engine
cd graphql-engine/console
npm ci
make server-build

Now go to your Hasura project and execute the console command:

cd hasura-project
hasura console --static-dir ~/graphql-engine/console/static/dist

Here is a zip file in case you don't want to build them: dist.zip

Unzip them and use it as the dist directory.

I would like to add a note that I would have expected the CLI console to also use the local assets from the docker image like the server console does. Tracking this via #3382

Thanks @shahidhk, the dist archive is empty but i've cloned and built and it works.

I'll support @rikinsk's issue as this is extra setup that could be improved and to avoid having the engine / cli / local assets end up at different versions and causing hard to debug issues. Really cool that I can work offline already though :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EmrysMyrddin picture EmrysMyrddin  路  3Comments

lishine picture lishine  路  3Comments

leoalves picture leoalves  路  3Comments

bogdansoare picture bogdansoare  路  3Comments

Fortidude picture Fortidude  路  3Comments