Skip to content

Clyff/graphql-server-api

Repository files navigation

GraphQL API Sample

This is a sample of GraphQL API.

Requesites

Installation

Install all dependencies with yarn:

$ yarn

Create a new file .env based on .env-example and run the docker container:

$ docker-compose up -d

If that is the first time you run the API, generate the tables e some data in the db:

$ yarn sequelize-skeleton

Usage

Run the following command and try Queries or mutations at: http://localhost:4000/graphql

$ yarn start

The following Queries and mutations are allowed:

  • saldo(conta: Int!): returns a int for the current balance of the given account.
  • sacar(conta: Int!, valor: Int!): Returns the given account, after usbtracting the value
  • depositar(conta: Int!, valor: Int!): Returns the given account, after adding the value.

TO DO list

  • Add a unit tests in the project
  • Add script to build to production (ops, lol)
  • Alot of refactoring
  • Create more Queries to generate new accounts (basic CRUD)
  • Develop a web application to consume the API

Docs used in this project:

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published