graphql-starter-kit

command module
v0.0.0-...-7967cdc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

README

GraphQL Starter Kit for GoLang

Golang implementation of a GraphQL server using Cassandra, MongoDB and REST backends inspired by Tutorial: How to build a GraphQL server.

Quick Start

Get the code:

go get github.com/nilstgmd/graphql-starter-kit

Start the Docker container running the GraphQL server, a container with Cassandra and a container with MongoDB (showterm.io):

cd  $GOPATH/src/github.com/nilstgmd/graphql-starter-kit/ && make all

Use the GraphiQL IDE in your browser http://localhost:8080/ or the API http://localhost:8080/graphql?query=... to execute queries against the server.

GraphiQL IDE

Example

Using GraphiQL:

{
  author(firstName:"Rob", lastName: "Pike"){
    firstName
    lastName
    posts{
      title
      views
    }
  }
  getFortuneCookie
}

Using cURL:

curl -XPOST http://localhost:8080/graphql \
-H 'Content-Type: application/graphql' \
-d 'query Root{ author(firstName:"Andrew",lastName:"Gerrand"){firstName,lastName,posts{title,views}},getFortuneCookie }'

Extra

Just because it is cool: Flamegraphs 🔥

Flamegraph

The GraphQL server offers a pprof endpoint which can be consumed to create flamegraphs with go-torch.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL