Home

Awesome

Golang-Relay Starter Kit

This kit includes:

For a walkthrough, see the Relay tutorial.

Notes:

This is based on alpha version of graphql-go and graphql-relay-go. Be sure to watch both repositories for latest changes.

Installation

npm install
go get -v

Running

Start a local server:

npm start

The above command will run both the NodeJS app server and Golang GraphQL server concurrently.

Developing

JavaScript

Any changes you make to files in the js/ directory will cause the server to automatically rebuild the app and refresh your browser.

Golang

Schema data

Since Golang does not support loading package / module dynamically, remember to update the package import for schema data in:

For e.g

import (
  ...
  "github.com/sogko/golang-relay-starter-kit/data" // <--- update to package containing schema
)

Schema updates

If at any time you make changes to data/schema.go, stop the server, regenerate data/schema.json, and restart the server:

npm run update-schema
npm start

schema.json is needed by the JS code for ./build/babelRelayPlugin.js

Examples

Feel free to submit a PR to add to this list.

TODOs

Credits

This kit is build on top of https://github.com/relayjs/relay-starter-kit