Plugin to enable generating fully functional backend using GraphQL-Cli
Command line tool is basing on Graphback project. Graphback is a CLI tool that can help you bootstrap a GraphQL server and client for you including GraphQL schema, resolvers and generating database structure. Graphback addresses the difficulty in configuring a GraphQL server from scratch.
For more information please follow https://graphback.dev
Install graphql-cli
using
npm i -g graphql-cli
Install the plugin using
npm i -g graphql-cli-graphback-plugin
Installing the plugin exposes the commands of Graphback. All the commands are prefixed with backend-
. For example graphql backend-init
.
The command will guide you through a series of questions - choosing a template, bootstraping model, selecting preferred database - and setup your project for you.
graphql backend-init <project name>
The command will generate schema and resolvers, with CRUD operations according to your GraphQL data model.
The command will create database resources according to your datamodel(including tables and relationships). Running the commands recreates the database structure i.e. drops all existing data.
You can run created server using npm run start