{"id":13413712,"url":"https://github.com/graphql-go/graphql","last_synced_at":"2025-05-12T03:47:30.456Z","repository":{"id":37742804,"uuid":"39332913","full_name":"graphql-go/graphql","owner":"graphql-go","description":"An implementation of GraphQL for Go / Golang","archived":false,"fork":false,"pushed_at":"2025-04-01T16:56:20.000Z","size":3717,"stargazers_count":10044,"open_issues_count":235,"forks_count":842,"subscribers_count":143,"default_branch":"master","last_synced_at":"2025-05-01T10:12:01.606Z","etag":null,"topics":["graphql","graphql-go","subscriptions"],"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/graphql-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2015-07-19T12:25:43.000Z","updated_at":"2025-05-01T05:37:51.000Z","dependencies_parsed_at":"2022-07-14T08:49:33.481Z","dependency_job_id":"6d1a6690-e644-4cc1-8961-10c73bd6f262","html_url":"https://github.com/graphql-go/graphql","commit_stats":{"total_commits":693,"total_committers":99,"mean_commits":7.0,"dds":0.7835497835497836,"last_synced_commit":"a9741863816e423e4287fd8947731d637451cf6c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-go%2Fgraphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-go%2Fgraphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-go%2Fgraphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-go%2Fgraphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-go","download_url":"https://codeload.github.com/graphql-go/graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251857022,"owners_count":21655121,"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":["graphql","graphql-go","subscriptions"],"created_at":"2024-07-30T20:01:47.141Z","updated_at":"2025-05-01T10:12:06.621Z","avatar_url":"https://github.com/graphql-go.png","language":"Go","readme":"# graphql [![CircleCI](https://circleci.com/gh/graphql-go/graphql/tree/master.svg?style=svg)](https://circleci.com/gh/graphql-go/graphql/tree/master) [![Go Reference](https://pkg.go.dev/badge/github.com/graphql-go/graphql.svg)](https://pkg.go.dev/github.com/graphql-go/graphql) [![Coverage Status](https://coveralls.io/repos/github/graphql-go/graphql/badge.svg?branch=master)](https://coveralls.io/github/graphql-go/graphql?branch=master) [![Join the chat at https://gitter.im/graphql-go/graphql](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/graphql-go/graphql?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nAn implementation of GraphQL in Go. Follows the official reference implementation [`graphql-js`](https://github.com/graphql/graphql-js).\n\nSupports: queries, mutations \u0026 subscriptions.\n\n### Documentation\n\ngodoc: https://pkg.go.dev/github.com/graphql-go/graphql\n\n### Contribute Back\n\nFriendly reminder links are available in case you would like to contribute back into our commitment with Go and open-source.\n\n| Author        |  PayPal Link  |\n|:-------------:|:-------------:|\n| [Hafiz Ismail](https://github.com/sogko) | Not available yet. |\n| [Chris Ramón](https://github.com/chris-ramon) | https://www.paypal.com/donate/?hosted_button_id=WHUQQYEMTRQBJ |\n\n### Getting Started\n\nTo install the library, run:\n```bash\ngo get github.com/graphql-go/graphql\n```\n\nThe following is a simple example which defines a schema with a single `hello` string-type field and a `Resolve` method which returns the string `world`. A GraphQL query is performed against this schema with the resulting output printed in JSON format.\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/graphql-go/graphql\"\n)\n\nfunc main() {\n\t// Schema\n\tfields := graphql.Fields{\n\t\t\"hello\": \u0026graphql.Field{\n\t\t\tType: graphql.String,\n\t\t\tResolve: func(p graphql.ResolveParams) (interface{}, error) {\n\t\t\t\treturn \"world\", nil\n\t\t\t},\n\t\t},\n\t}\n\trootQuery := graphql.ObjectConfig{Name: \"RootQuery\", Fields: fields}\n\tschemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)}\n\tschema, err := graphql.NewSchema(schemaConfig)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create new schema, error: %v\", err)\n\t}\n\n\t// Query\n\tquery := `\n\t\t{\n\t\t\thello\n\t\t}\n\t`\n\tparams := graphql.Params{Schema: schema, RequestString: query}\n\tr := graphql.Do(params)\n\tif len(r.Errors) \u003e 0 {\n\t\tlog.Fatalf(\"failed to execute graphql operation, errors: %+v\", r.Errors)\n\t}\n\trJSON, _ := json.Marshal(r)\n\tfmt.Printf(\"%s \\n\", rJSON) // {\"data\":{\"hello\":\"world\"}}\n}\n```\nFor more complex examples, refer to the [examples/](https://github.com/graphql-go/graphql/tree/master/examples/) directory and [graphql_test.go](https://github.com/graphql-go/graphql/blob/master/graphql_test.go).\n\n### Third Party Libraries\n| Name          | Author        | Description  |\n|:-------------:|:-------------:|:------------:|\n| [graphql-go-handler](https://github.com/graphql-go/graphql-go-handler) | [Hafiz Ismail](https://github.com/sogko) | Middleware to handle GraphQL queries through HTTP requests. |\n| [graphql-relay-go](https://github.com/graphql-go/graphql-relay-go) | [Hafiz Ismail](https://github.com/sogko) | Lib to construct a graphql-go server supporting react-relay. |\n| [golang-relay-starter-kit](https://github.com/sogko/golang-relay-starter-kit) | [Hafiz Ismail](https://github.com/sogko) | Barebones starting point for a Relay application with Golang GraphQL server. |\n| [dataloader](https://github.com/nicksrandall/dataloader) | [Nick Randall](https://github.com/nicksrandall) | [DataLoader](https://github.com/facebook/dataloader) implementation in Go. |\n\n### Blog Posts\n- [Golang + GraphQL + Relay](https://wehavefaces.net/learn-golang-graphql-relay-1-e59ea174a902)\n\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=WHUQQYEMTRQBJ"],"categories":["Popular","Misc","开源类库","Go","Query Language","Libraries","Open source library","Go语言包管理","Relational Databases","Implementations","查询语言","Uncategorized","GraphQL [🔝](#readme)","\u003ca name=\"Go\"\u003e\u003c/a\u003eGo","\u003cspan id=\"查询语言-query-language\"\u003e查询语言 Query Language\u003c/span\u003e"],"sub_categories":["查询语言","HTTP Clients","Go Libraries","Advanced Console UIs","Query Language","查询语","Go","HTTP客户端","Uncategorized","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-go%2Fgraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-go%2Fgraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-go%2Fgraphql/lists"}