An open API service indexing awesome lists of open source software.

https://github.com/aiirononeko/mameuri-graphql-server

『mameuri』 graphql server made by golang
https://github.com/aiirononeko/mameuri-graphql-server

docker-compose golang gqlgen graphql

Last synced: 3 months ago
JSON representation

『mameuri』 graphql server made by golang

Awesome Lists containing this project

README

          

# How to start server
execute command below
```
go run server.go
```

# How to update DB Schema
1. Modify shema.graphqls file
2. execute command below
```
go run github.com/99designs/gqlgen
```

# If library throws unkown exceptions
1. Buck up my code(resolver.go, schema.graphql, schema.resolver.go, server.go, etc..)
2. Delete my code
3. ReGenerate
https://gqlgen.com/getting-started/

# How to setup DB
- Connect
```
psql -d mameuri_dev -U postgres;
```
- Create Database
```
CREATE DATABASE mameuri_dev;
```
- Create Table
```
CREATE TABLE business_users (id serial PRIMARY KEY, email VARCHAR(50) NOT NULL UNIQUE, password VARCHAR(50) NOT NULL);
CREATE TABLE business_info (id serial PRIMARY KEY, user_id text NOT NULL UNIQUE, name VARCHAR(50) NOT NULL, description text, product_ids text[], address text);
CREATE TABLE products (id serial PRIMARY KEY, business_id text NOT NULL, name VARCHAR(50) NOT NULL, description text NOT NULL, price INTEGER NOT NULL);
```