šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

github.com/beinan/graphql-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/beinan/graphql-server

v0.0.0-20180824031009-4e87fee728ca
Source
Go
Version published
Created
Source

GraphQL Server Boilerplate in golang [WIP]

Setup

We are using Github to manage the dependencies.

Install Glide

curl https://glide.sh/get | shl

Install dependencies

glide install

Install Docker Compose (Optional)

Development

Directory Structure

ā”œā”€ā”€ /server.go               # Http Service entry point
ā”œā”€ā”€ /schema/                 # GraphQL schema defination
ā”œā”€ā”€ /utils/                  # Utilities
│   ā”œā”€ā”€ /password.go         # Password hashing via bcrypt
ā”œā”€ā”€ /vendor/                 # 3rd-party code managed by Glide

Start a devel server via docker compose

With a single docker-compose command, we are able to start MongoDB, Redid and our graphql server. See Start devel server section.

Build the docker image of graphql server

Note: You only need to do a build when Dockerfile has changed

docker-compose build

Start devel server

docker-compose up

We are using Fresh for watching source files (*.go) changes, and restarting the graphql server inside a docker container.

You might need the setting below if you got "graphql_1 | inotify_init: too many open files"

fs.inotify.max_user_instances=32768

For arch linux users, you can put this into a config file e.g. /etc/sysctl.d/99-sysctl.conf

Stop devel server

Ctrl - C or

docker-compose down

Add new dependency

glide get github.com/{author}/{packange_name}

FAQs

Package last updated on 24 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts