Skip to content

Dominic-Preap/go-gql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Graphql Go Boilerplate

📋 Introduction

A simple Graphql Go HTTP server boilerplate. This boilerplate project can be fully customized to your needs.

Thanks to VSCode and Go, we can have a fully intellisense when coding. It come with .vscode/extensions.json for recommended extensions.

Requirements

  1. Download and install Go
  2. Run the command go get -u to install dependencies
  3. (Opt) Install Air if you want ☁️ Live reload
# install air via go commannd
$ go get -u github.com/cosmtrek/air
  1. Copy .env.example to new env file .env and fill the environment variables
# Application (development, production)
ENV=development
PORT=8080
SECRET_KEY="5cR3t_K37"

# Gorm Credential
GORM_LOGMODE=true
GORM_DIALECT=postgres
GORM_CONNECTION_DSN="postgres://username:password@localhost:port/database"

Quick start

# run server and visit localhost:8080 for graphql playground
$ go run main.go

# or run live reload go via air and visit localhost:8080
$ air -d

Features

  • [] TODO

Development

  • [] TODO
# generate dataloader file if you are using one
$ dataloaden UserLoader int *github.com/my/app/model.User

# -or-
$ go run github.com/vektah/dataloaden UserLoader int *github.com/my/app/model.User

# run command everything you're changing the Graphql Schema file *.gql
$ gqlgen generate
$ go run github.com/99designs/gqlgen

# clean your project dependencies
$ go get tidy

# running unit test
$ go test -timeout 30s -coverprofile=c.out ./... && go tool cover -html=c.out
$ goconvey

About

A simple Graphql Go Http server boilerplate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages