Create your database and service layer from GraphQL types!
This project is still in alpha.
On npm
npm install -s @eunovo/superbackend
On yarn
yarn add @eunovo/superbackend
Define your entities in a graphql file
"""
@model
"""
type User {
username: String
password: String
}
Instantiate your backend services and repositories
import {
AuthorizationPlugin,
buildMongoRepo,
SuperBackend,
RelationshipPlugin,
UsernamePasswordAuthPlugin
} from '@eunovo/superbackend';
const schemaPath = `<YOUR_GRAPHQL_FILE>`;
const backend = new SuperBackend(buildMongoRepo);
backend.plugin(new RelationshipPlugin());
backend.plugin(new UsernamePasswordAuthPlugin());
backend.plugin(new AuthorizationPlugin());
const { models, repos, services } = backend.build(schemaPath);
Licensed under the MIT license