Skip to content
This repository has been archived by the owner on Jul 14, 2019. It is now read-only.

a number of problems setting up app #2

Open
stepheneb opened this issue Jun 25, 2019 · 1 comment
Open

a number of problems setting up app #2

stepheneb opened this issue Jun 25, 2019 · 1 comment

Comments

@stepheneb
Copy link

Following steps here: https://github.com/hasura/elm-graphql#running-the-app-yourself

Looking at steps wasn't clear how the first two steps related to the rest:

  • Deploy Postgres and GraphQL Engine on Heroku
  • Get the Heroku app URL (say todo-mvc-elm-backend1.herokuapp.com)

So I started with "Clone this repo:".

  1. Goto hasura/ and edit config.yaml

There is no hasura top-level directory.

I modified the the endpoint in schema/config.yaml instead

$ cat schema/config.yaml
endpoint: https://todo-mvc-elm-backend1.herokuapp.com
access_key: secret123
  1. Running hasura migrate apply fails:
$ hasura migrate apply
FATA[0000] validating current directory failed: validate: cannot find [config.yaml, migrations] | search stopped at filesystem boundary 

If I cd into schema first the migration succeeds:

$ cd schema
[schema ruby-2.6.3 (master)]$ hasura migrate apply
INFO migrations applied                           
  1. There is no graphql_url in src/Main.elm. It is located in src/GraphQLClient.elm and already has the value: "https://todo-mvc-elm-backend1.herokuapp.com/v1alpha1/graphql"

  2. The const that needs to be updated in src/index.js appears to be GRAPHQL_URI not HASURA_GRAPHQL_URL. GRAPHQL_URI is already set to: 'todo-mvc-elm-backend1.herokuapp.com/v1alpha1/graphql'

  3. The npm commands to install dependencies and generate the Elm code with elm-graphql need to be run in the elm-app/ dir not in the root of the repository.

6 In order to generate the Elm code for the url in the generate-graph-types script invocation in elm-app/package.json also needs to be updated.

Original:

    "generate-graph-types": "elm-graphql http://localhost:8080/v1alpha1/graphql --base Hasura --header 'x-hasura-admin-secret: secret123'"

Updated:

    "generate-graph-types": "elm-graphql https://todo-mvc-elm-backend1.herokuapp.com/v1alpha1/graphql --base Hasura --header 'x-hasura-admin-secret: secret123'"
  1. Running npm start in directory elm-app/ succeeds but web app just displays: "Sign in" page. Registration does not work.

The signup and login urls in src/Main.elm are referencing: https://guarded-woodland-47581.herokuapp.com`. Changing these to: https://todo-mvc-elm-backend1.herokuapp.com and attempting to register also fails.

@stepheneb
Copy link
Author

Registration and login are now succeeding with requests to: https://guarded-woodland-47581.herokuapp.com/signup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant