Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Pepeye/relay-starter

Repository files navigation

relay-starter: Relay/GraphQL Starter

GraphQL server using node / express and written in ES6 (ES2015) and ES7 (ES2016).

I built this starter because there are limited examples I've found of Relay flavoured GraphQL backends built in a modular manner. Most examples are of Todo apps with simple one file schemas. I was getting into undefined nodes OR cyclical node errors until i discovered some interesting approaches here: Abstract type resolution for node definitions.

Getting Started

npm i

create a file in the project root called .env and within it set environment variables NEO4J_USER and NEO4J_PASS. Note you can also edit database credentials in the file src/lib/db.js

example .env file

NODE_ENV=development
NEO4J_USER=neo4j
NEO4J_PASS=neopass
DEBUG=api:*

to start, run:

npm start

To run tests:

npm test

Database

Sample database is the Neo4j Movie database found here. This starter kit is using Neo4j 3.0 but feel free to swap in your own database.

Install

Setup you Neo4j database as per above running the Movie sample then the following instructions

#clone the repo
git clone https://github.com/Pepeye/relay-starter.git
cd relay-starter
npm install

# first ensure Neo4j is running (port 7474), then:
npm start

Once running visit:

Stack

TODO

  • Introduce Relay flavoured (connections/nodes) GraphQL
  • Move GraphQL code back into previous modules/models
  • Add example mutation
  • Add custom GraphQL scalar types
  • Add typing with flow, example typed test
  • Setup karma test runner with coverage and mocha for studentsPerClass
  • Testing: introduce stubs

Releases

No releases published

Packages

No packages published

Languages