{"id":29574509,"url":"https://github.com/glyphack/graphql-golang","last_synced_at":"2025-07-19T08:35:17.584Z","repository":{"id":60163406,"uuid":"224231836","full_name":"Glyphack/graphql-golang","owner":"Glyphack","description":"A tutorial📚 for creating GrahpQL APIs in go","archived":false,"fork":false,"pushed_at":"2023-03-07T06:13:25.000Z","size":71,"stargazers_count":47,"open_issues_count":1,"forks_count":35,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T02:34:57.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.howtographql.com/graphql-go/0-introduction/","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/Glyphack.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T16:01:40.000Z","updated_at":"2025-01-05T17:00:00.000Z","dependencies_parsed_at":"2024-11-01T17:31:24.807Z","dependency_job_id":"5d4f9601-e831-4c09-a175-074d622983c3","html_url":"https://github.com/Glyphack/graphql-golang","commit_stats":null,"previous_names":["glyphack/go-graphql-hackernews"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Glyphack/graphql-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fgraphql-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fgraphql-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fgraphql-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fgraphql-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glyphack","download_url":"https://codeload.github.com/Glyphack/graphql-golang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fgraphql-golang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265905116,"owners_count":23846696,"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":[],"created_at":"2025-07-19T08:35:12.181Z","updated_at":"2025-07-19T08:35:17.574Z","avatar_url":"https://github.com/Glyphack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: ‌Introduction To GraphQL Server With Golang\npublished: false\ndescription: Introduction to GraphQL Server with Golang and Gqlgen.\ntags: graphql, go, api, gqlgen\n---\n## Table Of Contents\n- [Table Of Contents](#table-of-contents)\n  - [How to Run The Project](#how-to-run-project)\n  - [Motivation ](#motivation)\n      - [What is a GraphQL server?](#what-is-a-graphql-server)\n      - [Schema-Driven Development](#schema-driven-development)\n  - [Getting started ](#getting-started)\n      - [Project Setup](#project-setup)\n      - [Defining Our Schema](#defining-out-schema)\n  - [Queries](#queries)\n      - [What Is A Query](#what-is-a-query)\n      - [Simple Query](#simple-query)\n  - [Mutations](#mutations)\n      - [What Is A Mutation](#what-is-a-mutation)\n      - [A Simple Mutation](#a-simple-mutation)\n  - [Database](#database)\n      - [Setup MySQL](#setup-mysql)\n      - [Models and migrations](#models-and-migrations)\n  - [Create and Retrieve Links](#create-and-retrieve-links)\n      - [CreateLinks](#createlinks)\n      - [Links Query](#links-query)\n  - [Authentication](#authentication)\n      - [JWT](#jwt)\n      - [Setup](#setup)\n        - [Generating and Parsing JWT Tokens](#generating-and-parsing-jwt-tokens)\n        - [User Signup and Login Functionality](#user-signup-and-login-functionality)\n        - [Authentication Middleware](#authentication-middleware)\n  - [Continue Implementing schema](#continue-implementing-schema)\n    - [CreateUser](#createuser)\n    - [Login](#login)\n\t- [RefreshToken](#refresh-token)\n    - [Completing Our App](#completing-our-app)\n  - [Summary](#summary)\n    - [Further Steps](#further-steps)\n  \n  \n### How to Run The Project \u003ca name=\"how-to-run-project\"\u003e\u003c/a\u003e\nFirst start mysql server with docker:\n```bash\ndocker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=dbpass -e MYSQL_DATABASE=hackernews -d mysql:latest\n```\nThen create a Table names hackernews for our app:\n```sql\ndocker exec -it mysql bash\nmysql -u root -p\nCREATE DATABASE hackernews;\n```\nfinally run the server: \n```bash\ngo run server/server.go\n```\nNow navigate to https://localhost:8080 you can see graphiql playground and query the graphql server.\n\n\n### Tutorial\nto see the latest version of tutorial visit https://www.howtographql.com/graphql-go/0-introduction/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglyphack%2Fgraphql-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglyphack%2Fgraphql-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglyphack%2Fgraphql-golang/lists"}