{"id":18936317,"url":"https://github.com/shellbear/go-graphql-example","last_synced_at":"2025-04-15T18:31:26.874Z","repository":{"id":57521485,"uuid":"187092720","full_name":"shellbear/go-graphql-example","owner":"shellbear","description":"A production ready Go GraphQL example server.","archived":false,"fork":false,"pushed_at":"2024-06-12T22:54:15.000Z","size":451,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T00:41:11.260Z","etag":null,"topics":["ent","example","go","golang","gqlgen","graphql","schema","sqlite","webserver"],"latest_commit_sha":null,"homepage":"https://shellbear.me/blog/go-graphql-api","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellbear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-16T19:55:10.000Z","updated_at":"2024-04-28T09:31:23.000Z","dependencies_parsed_at":"2022-09-26T18:01:21.377Z","dependency_job_id":null,"html_url":"https://github.com/shellbear/go-graphql-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fgo-graphql-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fgo-graphql-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fgo-graphql-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fgo-graphql-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellbear","download_url":"https://codeload.github.com/shellbear/go-graphql-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129092,"owners_count":21217282,"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":["ent","example","go","golang","gqlgen","graphql","schema","sqlite","webserver"],"created_at":"2024-11-08T12:06:59.003Z","updated_at":"2025-04-15T18:31:26.020Z","avatar_url":"https://github.com/shellbear.png","language":"Go","readme":"# go-graphql-example\n\nAn example go web server implementing a GraphQL api with a Sqlite database.\n\n**Read the full article: https://shellbear.me/blog/go-graphql-api**\n\n![gopher](.github/images/gopher.jpg)\n\n## Usage\n\nUsing `go run`:\n```shell\n\u003e go run main.go\n2020/xx/xx xx:xx:xx connect to http://127.0.0.1:8080/ for GraphQL playground\n```\n\nUsing `go build`:\n```shell\n\u003e go build -o go-graphql-example .\n\u003e ./go-graphql-example\n2020/xx/xx xx:xx:xx connect to http://127.0.0.1:8080/ for GraphQL playground\n```\n\nYou can access the GraphQL playground at: [http://127.0.1:8080/](http://127.0.1:8080/)\n\n[![playground](.github/images/playground.png)](http://127.0.1:8080/)\n\n## Development\n\nAfter making changes to `ent/schema` or `graph` directory make sure to run the generate command:\n```shell\ngo generate ./...\n```\n\n## Database\n\nDatabase models are handled with [ent](https://entgo.io/).\n\nFollow the [instructions](https://entgo.io/docs/getting-started/) to install the ent CLI.\n\nTo add a new model:\n```shell\nent init [Model]\n```\n\nAnd start editing the new Model schema in `ent/schema/[model].go`.\n\nThen run the code generation tool:\n```shell\ngo generate ./...\n```\n\n## GraphQL\n\nGraphQL API is managed with [gqlgen](https://gqlgen.com/).\n\nTo update the API, edit the schema in `graph/schema.graphqls` or a create a new schema named: `graph/*.graphqls`.\n\nAfter making changes, run the code generation tool:\n```shell\ngo generate ./...\n```\n\nAnd implement code logic inside `graph/[schema].resolers.go`.\n\n## Built with\n\n- [ent](https://github.com/ent/ent)\n- [gqlgen](https://github.com/99designs/gqlgen)\n- [go-sqlite3](https://github.com/mattn/go-sqlite3)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellbear%2Fgo-graphql-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellbear%2Fgo-graphql-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellbear%2Fgo-graphql-example/lists"}