grand-stack / grand-stack-starter

Simple starter project for GRANDstack full stack apps

Home Page:https://grandstack.io/docs/getting-started-grand-stack-starter.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

seeddb command not working with neo4j sandbox

jreuben11 opened this issue · comments

I setup a neo4j sandbox DB, and ran npx create-grandstack-app. When I run npm run seedDb from /api subfolder, I get the following error message:

Error: Error: request to http://0.0.0.0:4001/graphql failed, reason: connect ECONNREFUSED 0.0.0.0:4001

my api/.env file generated by npx :

NEO4J_URI=<copied from sandbox.neo4j.com bolt URL>
NEO4J_USER=<copied from sandbox.neo4j.com username>
NEO4J_PASSWORD=<copied from sandbox.neo4j.com password>

GRAPHQL_SERVER_HOST=0.0.0.0   
GRAPHQL_SERVER_PORT=4001
GRAPHQL_SERVER_PATH=/graphql

To work with sandbox, what do I need to change here - HOST (I assume) / PORT / PATH ? - and what should the values be ?

Does this work if you use a local database? The error message seems like the client is not able to connect to the GraphQL API, so an error that occurs before the database connection.

@johnymontana we are not planning on using a local database - as we evaluate this technology stack, we are following the tutorial and using it against Neo4j sandbox. if that works, we will consider Aura managed Neo4j as a cloud service.

well, basically we're in the dark with regard to the following values, aren't we?

GRAPHQL_SERVER_HOST=0.0.0.0
GRAPHQL_SERVER_PORT=4001
GRAPHQL_SERVER_PATH=/graphql

to be found in the .env file in API - while the other env vars were correctly set by the init routine of setting up the project, what are the values that should be set here?

Random question, might seem silly at first. Are you running the GraphQL server before attempting a to run seed?
Sometimes it's better to get the obvious out of the way.

The seed process uses the GraphQL server to seed the DB, so that needs to be on for the seed to work. The error you're having seems to suggest that the seed process can't access the GQL server. If it's already running, then something might be interfering there. For example running it in a docker image without exposing the port, or something of that sort.