cardano-community / guild-operators

Artifacts and scripts created by Guild operators
https://cardano-community.github.io/guild-operators
MIT License
353 stars 179 forks source link

~/git/cardano-graphql/dist directory does not exist after yarn build #468

Closed TrevorBenson closed 4 years ago

TrevorBenson commented 4 years ago

Describe the bug Instructions say to cd ~/git/cardano-graphql/dist but after running yarn build directory does not exist and returns the following error:

# cd ~/git/cardano-graphql/dist
-bash: cd: /home/cardano/git/cardano-graphql/dist: No such file or directory

Using find ~/git/cardano-db-sync/ -type f -iname "index.js" | grep '/dist/' | wc -l there are 104 directories that are named dist which contain a file named index.js. There are too many dist/index.js to determine which one to start with node.

To Reproduce Steps to reproduce the behavior:

  1. Follow instructions to build from Build graphql
  2. See No such file or directory error when trying to cd ~/git/cardano-graphql/dist

Expected behavior

  1. The dist directory exists and changing to the directory succeeds.
  2. Running node index.js in the final step of instructions succeeds as the correct index.js file is present in ~/git/cardano-graphql/dist.

Version:

TrevorBenson commented 4 years ago

Looking at the instructions to build cardano-graphql from source it appears the directory and index.js in question are probably ~/git/cardano-graphql/packages/server/dist/index.js? If this is the correct path then whichever method below is preferred by the other contributors I will submit as a PR from my fork.

Symlink it: cd ~/git/cardano-graphql ; ln -s ./packages/server/dist ./

Dull copy of the source: cd ~/git/cardano-graphql ; cp -rf ./packages/server/dist ./

rdlrt commented 4 years ago

The graphql documentation is indeed behind. The dist folder being in root was output package that's moved since to packages/server/dist. We prolly might want to switch to that build folder instead of dist :

  1. To copy node_modules across
  2. To use something that is easily upgradable with future versions.

Also, the environment variables required would need to be updated as they've been changed since.

Scitz0 commented 4 years ago

I made a couple of notes last time I tried to build Hasura and cardano-graphql. Not sure if it is better handled in some other way or if there are more changes that are needed but here they are:

Hasura

Cardano GraphQL

rdlrt commented 4 years ago

FYI - this is parked for now, as cardano-graphql doco and prerequisites are not being maintained (was removed in #476 ). There is not a lot being bought to the table via cardano-graphql other than pre-defined queries, no reason why a lightweight service like postgREST or postgres.rest cant be used instead. Besides, this was only component using npm in the build tools.

This may be revisited in future

oldcryptogeek commented 4 years ago

o.0

TrevorBenson commented 4 years ago

@Scitz0 Anything that CNTools does not compile I will build a dedicated container for. Since cardano-graphql docs/prereqs are not being maintained I am closing out this ticket to reduce backlog.

If I misunderstood and you meant the upstream docs & prerequisites are not actively maintained and cardano-graphql is intended to remain part of CNTools feel free to reopen this issue.