Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

vijaykrishnavanshi/express-graphql-boilerplate

Repository files navigation

express-graphql-boilerplate

Build Status Greenkeeper badge GitHub

Boilerplate code to setup express apis with graphql

Run the project locally (Development)

Run the following command and the APIs will the available locally for testing and development.

git clone https://github.com/vijaykrishnavanshi/express-graphql-boilerplate.git <project-name>
cd project-name
npm install
npm run dev

Lint Project

npm run lint  # for cheking the lint error
npm run lint:fix # for fixing the minor lint error

Run Tests

Used Mocha

npm run test  # for running tests

Deploy the project

npm run deploy  # for deploying the project

Directory Structure:

log/
    Logs of the running server
src/
    generator/
        <generator.js>
    graphql/
        <module-1>/
            Query/
            Mutation/
            Subscriptions/
            <New TypeDef in GQL>
        <module-2>/
            Query/
            Mutation/
            Subscriptions/
            <New TypeDef in GQL>
    models/
        <model-1>
        <model-2>
        <index.js>
    utils/
        <logger.js>
package.json
README.md
LICENSE
Dockerfile

Plans

  • Add generator for autogenerating new GQL type and Query/Mutation for any module
  • Add test generator for autogenerating new test for any module in GQL

Explore