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
- Host: GitHub
- URL: https://github.com/aiirononeko/mameuri-graphql-server
- Owner: aiirononeko
- Created: 2022-11-13T10:29:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T15:14:16.000Z (over 3 years ago)
- Last Synced: 2025-01-11T00:22:05.313Z (over 1 year ago)
- Topics: docker-compose, golang, gqlgen, graphql
- Language: Go
- Homepage:
- Size: 219 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```