Golang-Relay Starter Kit
This kit includes:
- a NodeJS app server: to serve the front-end written with
- a Golang GraphQL server: to serve the back-end
graphql-goserver that handles GraphQL queries
- a Babel transpiler workflow using
webpackthat you can use to get started building an app with Relay.
For a walkthrough, see the Relay tutorial.
This is based on alpha version of
Be sure to watch both repositories for latest changes.
- Install dependencies for NodeJS app server
- Install dependencies for Golang GraphQL server
go get -v
Start a local server:
The above command will run both the NodeJS app server and Golang GraphQL server concurrently.
- Golang GraphQL server will be running at http://localhost:8080/graphql
- NodeJS app server will be running at http://localhost:3000
Any changes you make to files in the
js/ directory will cause the server to
automatically rebuild the app and refresh your browser.
Since Golang does not support loading package / module dynamically, remember to update the package import for schema data in:
import ( ... "github.com/sogko/golang-relay-starter-kit/data" // <--- update to package containing schema )
If at any time you make changes to
data/schema.go, stop the server,
data/schema.json, and restart the server:
npm run update-schema npm start
schema.json is needed by the JS code for
- todomvc-relay-go - Port of the React/Relay TodoMVC app, driven by a Golang GraphQL backend
Feel free to submit a PR to add to this list.
- Swap out
express-graphqlserver with a Golang GraphQL server
- GraphQL schema definition in Golang
schema.jsonfrom schema definition for
schema.graphqlfrom schema definition
This kit is build on top of https://github.com/relayjs/relay-starter-kit