The graphcool server-part of this repo is imported from the previous programming ladder. To this point, that part remains unchanged. The elm frontend is then designed to work on top of that existing backend.
The structure of this repo (branches etc.) follows this branching model
- If you do not have an account at Graphcool: Register for Graphcool
- Install Docker
- Install Elm
- Install Node
- Install Yarn
Install node packages:
yarn
- Install dependencies for the server:
cd ladder/server && yarn && graphcool local up
- Gå to the page for authentication for the Graphcool-project, copy the authentication command (should look like this:
graphcool login —token $TOKEN
) and run this. - Start developing with
graphcool deploy --target my-dev
_ If you get no errormessages (see below), chooseshared-eu-west-1
in the menu that pops up. You'll be prompted to enter a name for the service. Name itmy-dev
(or something else; it doesn't matter that much). _ I get the error-messageCannot read property 'viewer' of undefined
: Openladder/server/.graphcoolrc
if the file exists. Probably you've got a line in the file that begins withlocal:
. Delete this line and repeat the command above.
- Now you'll find the admin-interface for this instanse of Graphcool under the project
my-dev
on your Graphcool-console. - On the end of the text that pops up there is a list of URLs. Copy the URL after
Simple API:
. - Go to the client part of the project and find the
Main.elm
file and replace the value of the API reference with theSimple API
-URL you got from the previous step.
GraphQL as a service, Graphcool
$ cd server
$ graphcool deploy --target prod
In terminal run:
yarn start
Open http://localhost:8000
Simple Elm SPA examples:
- https://github.com/sporto/elm-tutorial-app
- https://github.com/malaire/elm-examples/blob/master/spa-basic/src/Main.elm
Complex Elm SPA examples
GrapQL and dillonkearns/elm-graphql: