/graphql-poc

Exploring GraphQL through an example app, using different tech stacks

Primary LanguageJavaScript

graphql-poc

This repository contains a small Star Wars themed example web app for using GraphQL, built as a study.

As such, the project is divided into multiple implementations of the frontend and backend parts, each exercising a different technology stack to achieve the same end result.

The Star Wars theme was chosen since the official GraphQL examples use this theme.

Prerequisites

  • Docker Docker 1.13+ with Docker Compose

Also make sure the ports forwarded from the containers (see docker-compose.yml) are available, or remove the port mappings. The database container port mappings exist for debugging purposes.

Running

  • Run docker-compose up

Note that the initial build of the images builds also the distributables (JARs etc) and this will take some time.

After the startup has completed, navigate to http://localhost:8000.

Frontend

Each frontend implementation should be able to query any backend. The currently used backend should be changeable from the user interface.

Redux (frontend-redux)

React Redux GraphQL

Served on port 8000. Uses isomorphic-fetch to directly access the GraphQL API endpoint.

Relay (frontend-relay)

Not implemented yet

Backend

Since GraphQL gives the frontend much freedom in querying the backend, the interface between the GraphQL schema and the data source is an important area of study.

The schema used exercises a range of GraphQL's facilities, including interfaces and deferred execution.

JVM + Relational (backend-akka-postgres)

Scala Akka Sangria Slick PostgreSQL

Explores using a relational data source with GraphQL, with Scala's usual Slick database access and query library.

JVM + Graph (backend-akka-orientdb)

Scala Akka Sangria Gremlin OrientDB

Explores using a graph data source with GraphQL using Apache Tinkerpop 3 Gremlin query language implementation for Scala.

Node + Graph (backend-express-arangodb)

NodeJS Express GraphQL.js ArangoDB

Explores using a graph data source with GraphQL using ArangoDB's AQL language via the ArangoJS driver.