• Stars
    star
    136
  • Rank 259,101 (Top 6 %)
  • Language
    Go
  • License
    Other
  • Created over 8 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Barebones starting point for a Relay application with Golang GraphQL server

Golang-Relay Starter Kit

This kit includes:

  • a NodeJS app server: to serve the front-end written with react-relay
  • 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.

Notes:

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

Installation

  • Install dependencies for NodeJS app server
npm install
  • Install dependencies for Golang GraphQL server
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:

  • graphql.go
  • scripts/updateSchema.go

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

  • 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.

TODOs

  • Swap out express-graphql server with a Golang GraphQL server
  • GraphQL schema definition in Golang
  • Generate schema.json from schema definition for babel-relay-plugin
  • Generate schema.graphql from schema definition

Credits

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

More Repositories

1

graphql-schema-language-cheat-sheet

GraphQL Shorthand Notation Cheat Sheet
1,328
star
2

slumber

A complete REST API server written in golang / go
Go
427
star
3

gulp-recipes

gulp-recipes
JavaScript
399
star
4

go-wordpress

Golang client library for WP-API (Wordpress REST API)
Go
126
star
5

todomvc-relay-go

React/Relay TodoMVC app, driven by a Golang GraphQL backend
JavaScript
66
star
6

node-osm-stream

Fast and flexible NodeJS-based streaming parser for OpenStreetMap (.osm) files powered by node-expat - @sogko
JavaScript
17
star
7

graphql-schemas

A collection of common and useful GraphQL Object schemas
15
star
8

slumber-books-api-example

An example REST-ful API server using slumber package written in golang
Go
11
star
9

gosg-graphql-go-demo

Demo and slides for GoSG Meetup #15 - May 2016
CSS
10
star
10

fossasia-2016-google-calendar

A quick and dirty little thing that takes FOSSASIA 2016 schedule and creates Google Calendars (and iCal .ics) out of it.
Go
9
star
11

data-gov-sg-graphql-go

A GraphQL endpoint for https://data.gov.sg real-time APIs (Go/Golang)
Go
8
star
12

arangojs-extended

Extended APIs for ArangoJS client library
JavaScript
6
star
13

slumber-users

slumber-users is a slumber-resource that implements slumber.IUser
Go
4
star
14

node-osm-tags-analysis

Analyse .osm tagged data using NodeJS and osmfilter
JavaScript
4
star
15

node-ckan-crawler

A simple and fast NodeJS based crawler for sites powered by CKAN http://ckan.org
JavaScript
3
star
16

react-starter

Pragmatic starter kit for React + ES6 + Babel + Webpack + Tape.
JavaScript
3
star
17

graphql-geojson-go

Go
2
star
18

pecker

Pecker is a modern assets management framework for your web application development.
JavaScript
2
star
19

humanable-json

JavaScript
1
star
20

generator-leaner

yoeman generator for LEANER stack (Lightweight & Leaner express-angular-node-requirejs full web application stack)
JavaScript
1
star
21

fossasia-2016-graphql-demo

Demo used to showcase GraphQL (on Go / Golang)
CSS
1
star
22

go-ratelimit

Golang package to ratelimit messages/connections per unit time
Go
1
star