Skip to content

antshc/sw-graphql

Repository files navigation

Warehouse GraphQL

GraphQL API endpoint as a standalone (micro)service, backing up web front-ends and/or mobile apps requests. It will be used for internal purposes and in future for external clients to share oor services.

Tech Stack

Directory Layout

.
├── /dist/                      # The compiled output (via TypeScript)
├── /src/                       # Node.js application source files
│   ├── /schema/                # GraphQL schema type definitions
│   ├── /server.ts              # Node.js server (entry point)
├── /types/                       # TypeScript type definitions
├── package.json                # List of project dependencies

Prerequisites

Getting Started

Just clone the repo and run docker-compose up:

git clone https://github.com/khdevnet/warehouse-graphql
cd example-api                  # Change current directory to the newly created one
docker-compose up               # Launch Docker containers with the Node.js API app running inside

The API server must become available at http://localhost:8080/graphql.

Once the Docker container named api is started, the Docker engine executes node tools/run.js command that installs Node.js dependencies, migrates database schema to the latest version, compiles Node.js app from source files (see src) and launches it with "live reload" on port 8080.

Testing

yarn lint                       # Find problematic patterns in code
yarn check                      # Check source code for type errors
yarn docker-test                # Run unit tests once inside a Docker container
yarn docker-test-watch          # Run unit tests in watch mode inside a Docker container

For more information visit http://facebook.github.io/jest/

Debugging

In order to run the app with V8 inspector enabled, simply replace node tools/run.js with node --inspect=0.0.0.0:9229 tools/run.js in either docker-compose.yml file or, even better, in docker-compose.override.yml. Then restart the app (docker-compose up) and attach your debugger to 127.0.0.1:9230 (see .vscode/launch.json)

Related Projects

  • GraphQL.js — The JavaScript reference implementation for GraphQL
  • DataLoader — Batching and caching for GraphQL data access layer
  • Membership Database — SQL schema boilerplate for user accounts, profiles, roles, and auth claims

Warehouse Navigation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published