This template is worth 2020 ✨.
Brought by GraphQL Editor Team
You get database with GraphQL interface for storing your data just from GraphQL Schema.
Like that, and it is only from GraphQL Schema!! :
These 2 are needed to run this
Clone this repo
git clone https://github.com/graphql-editor/graphql-backend-template-dgraph
To start with this template you will need GraphQL Schema. Create one with GraphQL Editor and copy its contents to
Example schema can look like this Schema
Remember when using Dgraph you need only Types, Interfaces and Enums. Also there is a small bug in Dgraph which doesnt allow comments in schema files.
Or if you are lazy:
Forget about the schema and use one inside repo. Do nothing and proceed.
Run this command in one terminal
npm run dgraph
And run this command in the other one
npm run inject-dgraph-schema
Voila. Your GraphQL native database is ready to use. Run queries in a tool like Firecamp, so Insomnia, GraphiQL etc.
npm run generate-nodets
npm run generate-nodejs
npm run generate-ts
npm run generate-js
Twitter - follow me for latest news with this boilerplate
Github - follow me for the latest news with this boilerplate