This kit includes:
- a Golang GraphQL server: to serve the back-end
graphql-go
server that handles GraphQL queries - a Babel transpiler workflow using
webpack
that you can use to get started building an app with Relay.
For a walkthrough, see the Relay tutorial.
This is based on playlyfe/graphql
implementation but it can be customized for other implementation as well.
Be sure to watch the repository for future changes!
- Install dependencies for NodeJS app server
npm install
- Install dependencies for Golang GraphQL server
go get -v
Start a local server:
npm start
The above command will run both the go-graphql server and will display a simple Hello world!
based on the API.
Any changes you make to files in the src/
directory will cause the server to
automatically rebuild the app and refresh your browser.
The Schema and Resolvers should be kept in data/graphql.go
.
Since Golang does not support loading package / module dynamically, after updating the data/graphql.go
file, make sure to update the schema:
graphql.go
utils/updateSchema.go
If at any time you make changes to data/graphql.go
, stop the server,
rebuild data/schema.json
and restart the server:
npm run update-schema
npm start
schema.json
is needed by the JS code for ./utils/babelRelayPlugin.js
This starter kit provides a simple go-graphql API that displays "Hello world!"
Feel free to submit a PR to add to this list.
- Make it production-ready
- Check Modern Relay compatibility
This kit is build on top of https://github.com/relayjs/relay-starter-kit