{"id":15619302,"url":"https://github.com/moemoe89/go-graphql-gendhis","last_synced_at":"2026-04-11T13:09:14.472Z","repository":{"id":102325091,"uuid":"245006860","full_name":"moemoe89/go-graphql-gendhis","owner":"moemoe89","description":"🤙 This repo for practicing GraphQL using Golang , Docker and PostgreSQL","archived":false,"fork":false,"pushed_at":"2020-06-14T15:39:00.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T16:14:43.721Z","etag":null,"topics":["circleci","clean-architecture","codecov","docker","gin","go","golang","graphql","postgresql","rest-api","swagger","uncle-bob"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moemoe89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-04T21:23:43.000Z","updated_at":"2024-06-19T07:55:11.337Z","dependencies_parsed_at":null,"dependency_job_id":"fe3033dd-7a35-4c9b-97df-9dbc9a2d7f97","html_url":"https://github.com/moemoe89/go-graphql-gendhis","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-graphql-gendhis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-graphql-gendhis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-graphql-gendhis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-graphql-gendhis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moemoe89","download_url":"https://codeload.github.com/moemoe89/go-graphql-gendhis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246202794,"owners_count":20740029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circleci","clean-architecture","codecov","docker","gin","go","golang","graphql","postgresql","rest-api","swagger","uncle-bob"],"created_at":"2024-10-03T08:04:47.813Z","updated_at":"2025-12-30T23:18:25.316Z","avatar_url":"https://github.com/moemoe89.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/moemoe89/go-graphql-gendhis.svg?style=svg)](https://circleci.com/gh/moemoe89/go-graphql-gendhis)\n[![codecov](https://codecov.io/gh/moemoe89/go-graphql-gendhis/branch/master/graph/badge.svg)](https://codecov.io/gh/moemoe89/go-graphql-gendhis)\n[![Go Report Card](https://goreportcard.com/badge/github.com/moemoe89/go-graphql-gendhis)](https://goreportcard.com/report/github.com/moemoe89/go-graphql-gendhis)\n\n# GO-GRAPHQL-GENDHIS #\n\nPracticing GraphQL Using Golang (Gin Gonic Framework) as Programming Language, PostgreSQL as Database\n\n## Directory structure\nYour project directory structure should look like this\n```\n  + your_gopath/\n  |\n  +--+ src/github.com/moemoe89\n  |  |\n  |  +--+ go-graphql-gendhis/\n  |     |\n  |     +--+ main.go\n  |        + api/\n  |        + routers/\n  |        + ... any other source code\n  |\n  +--+ bin/\n  |  |\n  |  +-- ... executable file\n  |\n  +--+ pkg/\n     |\n     +-- ... all dependency_library required\n\n```\n\n## Setup and Build\n\n* Setup Golang \u003chttps://golang.org/\u003e\n* Setup PostgreSQL \u003chttps://www.postgresql.org/\u003e\n* Under `$GOPATH`, do the following command :\n```\n$ mkdir -p src/github.com/moemoe89\n$ cd src/github.com/moemoe89\n$ git clone \u003curl\u003e\n$ mv \u003ccloned directory\u003e go-graphql-gendhis\n```\n\n## Running Migration\n* Copy `config-sample.json` to `config.json` and changes the value based on your configurations.\n* Create PostgreSQL database for example named `simple_api` and do migration with `Goose` \u003chttps://bitbucket.org/liamstask/goose/\u003e\n* Change database configuration on dbconf.yml like `dialect` and `dsn` for each environtment\n* Do the following command\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ goose -env=development up\n```\n\n## Documetation with Swagger\nFor open swagger access via browser\n```\n{{url}}/swagger/index.html\n```\nFor updating swagger\n```\n$ swag init\n```\n\n## Running Application with Makefile\nMake config file for local :\n```\n$ cp config-sample.json config-local.json\n```\nBuild\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make build\n```\nRun\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make run\n```\nStop\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make stop\n```\nMake config file for docker :\n```\n$ cp config-sample.json config-docker.json\n```\nDocker Build\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make docker-build\n```\nDocker Up\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make docker-up\n```\nDocker Down\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-graphql-gendhis\n$ make docker-down\n```\n\n## How to Run with Docker\nMake config file for docker :\n```\n$ cp config-sample.json config.json\n```\nBuild\n```\n$ docker-compose build\n```\nRun\n```\n$ docker-compose up\n```\nStop\n```\n$ docker-compose down\n```\n\n## How to Run Unit Test\nRun\n```\n$ go test ./...\n```\nRun with cover\n```\n$ go test ./... -cover\n```\nRun with HTML output\n```\n$ go test ./... -coverprofile=c.out \u0026\u0026 go tool cover -html=c.out\n```\n\n## Example Request\nNavigate your browser to this url for running the GraphQL console\n```\n/api/v1/graphql/user\n```\n### Create\n```\nPOST /api/v1/graphql/user\nContent-Type: application/json\n{\n\t\"query\": \"mutation{Create(name:\\\"momo\\\",phone:\\\"0856\\\",email:\\\"m@m.com\\\",address:\\\"Indonesia\\\"){id,name,phone,email,address}}\"\n}\n```\n### List\n```\nPOST /api/v1/graphql/user\nContent-Type: application/json\n{\n\t\"query\": \"{List(per_page:\\\"10\\\",page:\\\"1\\\",order_by:\\\"\\\",name:\\\"\\\",phone:\\\"\\\",email:\\\"\\\",created_at_start:\\\"\\\",created_at_end:\\\"\\\",select_field:\\\"\\\"){list{id,name,phone,email,address}}}\"\n}\n```\n### Detail\n```\nPOST /api/v1/graphql/user\nContent-Type: application/json\n{\n\t\"query\": \"{Detail(id:\\\"bph2mlript32plmed820\\\"){id,name,phone,email,address}}\"\n}\n```\n### Update\n```\nPOST /api/v1/graphql/user\nContent-Type: application/json\n{\n\t\"query\": \"mutation{Update(id:\\\"bpielbbipt341rif5i20\\\",name:\\\"momo update\\\",phone:\\\"0856\\\",email:\\\"m@m.com\\\",address:\\\"Indonesia\\\"){id,name,phone,email,address}}\"\n}\n```\n### Delete\n```\nPOST /api/v1/graphql/user\nContent-Type: application/json\n{\n\t\"query\": \"mutation{Delete(id:\\\"bpielbbipt341rif5i20\\\")}\"\n}\n```\n\n## Reference\n\nThanks to this medium [link](https://medium.com/easyread/graphql-delivery-on-golangs-clean-architecture-5c995a17b3a8) for sharing the great article\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoemoe89%2Fgo-graphql-gendhis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoemoe89%2Fgo-graphql-gendhis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoemoe89%2Fgo-graphql-gendhis/lists"}