{"id":15157958,"url":"https://github.com/sohelamin/graphql-postgres-go","last_synced_at":"2025-10-24T14:31:19.983Z","repository":{"id":61625564,"uuid":"127791612","full_name":"sohelamin/graphql-postgres-go","owner":"sohelamin","description":"A GraphQL complete example using Golang \u0026 PostgreSQL","archived":false,"fork":false,"pushed_at":"2018-04-02T17:54:49.000Z","size":2,"stargazers_count":76,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T02:04:47.829Z","etag":null,"topics":["golang","graphql","postgresql"],"latest_commit_sha":null,"homepage":null,"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/sohelamin.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":"2018-04-02T17:50:08.000Z","updated_at":"2024-11-08T22:23:40.000Z","dependencies_parsed_at":"2022-10-18T18:15:20.592Z","dependency_job_id":null,"html_url":"https://github.com/sohelamin/graphql-postgres-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohelamin%2Fgraphql-postgres-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohelamin%2Fgraphql-postgres-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohelamin%2Fgraphql-postgres-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohelamin%2Fgraphql-postgres-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sohelamin","download_url":"https://codeload.github.com/sohelamin/graphql-postgres-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237982358,"owners_count":19397249,"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":["golang","graphql","postgresql"],"created_at":"2024-09-26T20:21:06.728Z","updated_at":"2025-10-24T14:31:15.519Z","avatar_url":"https://github.com/sohelamin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# GraphQL with Golang\n\u003e A GraphQL complete example using Golang \u0026 PostgreSQL\n\n## Installation\nInstall the dependencies\n```\ngo get github.com/graphql-go/graphql\ngo get github.com/graphql-go/handler\ngo get github.com/lib/pq\n```\n\nInstall \u0026 create postgres database\n```\nbrew install postgres\ncreateuser graphql --createdb\ncreatedb graphql -U graphql\npsql graphql -U graphql\n```\nNote: Non-Mac users follow official doc to install the `PostgreSQL`\n\nCreate the tables\n```sql\nCREATE TABLE IF NOT EXISTS authors\n(\n    id serial PRIMARY KEY,\n    name varchar(100) NOT NULL,\n    email varchar(150) NOT NULL,\n    created_at date\n);\n\nCREATE TABLE IF NOT EXISTS posts\n(\n    id serial PRIMARY KEY,\n    title varchar(100) NOT NULL,\n    content text NOT NULL,\n    author_id int,\n    created_at date\n);\n```\n\n ## Usage\n Query to get the all authors\n```\nquery {\n  authors {\n    id\n    name\n    email\n    created\n  }\n}\n```\n\nQuery to get a specific author\n```\nquery {\n  author(id: 1) {\n    id\n    name\n    email\n  }\n}\n```\n\nCreate new author using mutation\n```\nmutation {\n  createAuthor(name: \"Sohel Amin\", email: \"sohelamincse@gmail.com\") {\n    id\n    name\n    email\n  }\n}\n```\n\nUpdate an author using mutation\n```\nmutation {\n  updateAuthor(id: 2, name: \"Sohel Amin Shah\", email: \"sohel@sohelamin.com\") {\n    id\n    name\n    email\n  }\n}\n```\n\nDelete an author using mutation\n```\nmutation {\n  deleteAuthor(id: 2) {\n    id\n  }\n}\n```\n\nQuery to get the posts with its relation author\n```\nquery {\n  posts {\n    id\n    title\n    content\n    author {\n      id\n      name\n      email\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohelamin%2Fgraphql-postgres-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsohelamin%2Fgraphql-postgres-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohelamin%2Fgraphql-postgres-go/lists"}