GithubHelp home page GithubHelp logo

graphql's Introduction

GraphQL API - CRUD

This GraphQL API allows users to:

  • Construct complex queries to get episodes, characters and locations
  • Create and delete episodes, characters and locations
  • Edit locations

Environment variables

These are the environment variables needed for the project to run correctly:
You must fill the information of your MySQL database

NODE_ENV="development" # Set to "production" if in production environment
PORT="3000" # Port of the app
LOGGER_LEVEL="debug" # Level of the logger
ROOT_PATH="/api" # Root url of the api
GRAPHQL_UI="TRUE" # Variable that defines if the UI is available
DATABASE_HOST="<host>" # Database's host
DATABASE_USER="<user>" # Database's user
DATABASE_PASSWORD="<password>" # Database's password
DATABASE_NAME="<name>" # Database's name
DATABASE_PORT="3306" # Database's port
DATABASE_SSL="FALSE" # Specifies if the database uses SSL connection
DEPTH_LIMIT="8" # Defines the number of deep levels in the GraphQL queries. Can be left blank
MIGRATE_DATABASE="FALSE" # Defines if the structure of the database must be migrated

Installation

The environment must have Node JS and the npm package manager installed.
Run the following command to install the necessary libraries.

npm install

Test the project

This is the command to run the unit tests:

npm test

Starting the project

Local

This is the command to run the project:

npm run dev

Production

This is the command to run the project:

npm start

This is the successful result:

[2022-11-19T10:55:04.725] [INFO] default - Database started
[2022-11-19T10:55:04.729] [INFO] default - HTTP Server listening in port 3000

NOTE: The first time the project is started, the environment variable MIGRATE_DATABASE must be equal to TRUE, in order to initialize the structure of the database. Then, you can set the same variable to FALSE, so it will not be migrated again.

graphql's People

Contributors

briter06 avatar

Watchers

 avatar

Forkers

guptarame bgr-su

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.