[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5054":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":29,"discoverSource":30},5054,"graphql","graphql-go\u002Fgraphql","graphql-go","An implementation of GraphQL for Go \u002F Golang","",null,"Go",10154,840,141,200,0,2,6,43.77,"MIT License",false,"master",true,[5,7,25],"subscriptions","2026-06-12 02:01:07","# graphql [![CircleCI](https:\u002F\u002Fcircleci.com\u002Fgh\u002Fgraphql-go\u002Fgraphql\u002Ftree\u002Fmaster.svg?style=svg)](https:\u002F\u002Fcircleci.com\u002Fgh\u002Fgraphql-go\u002Fgraphql\u002Ftree\u002Fmaster) [![Go Reference](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql) [![Coverage Status](https:\u002F\u002Fcoveralls.io\u002Frepos\u002Fgithub\u002Fgraphql-go\u002Fgraphql\u002Fbadge.svg?branch=master)](https:\u002F\u002Fcoveralls.io\u002Fgithub\u002Fgraphql-go\u002Fgraphql?branch=master) [![Join the chat at https:\u002F\u002Fgitter.im\u002Fgraphql-go\u002Fgraphql](https:\u002F\u002Fbadges.gitter.im\u002FJoin%20Chat.svg)](https:\u002F\u002Fgitter.im\u002Fgraphql-go\u002Fgraphql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nAn implementation of GraphQL in Go. Follows the official reference implementation [`graphql-js`](https:\u002F\u002Fgithub.com\u002Fgraphql\u002Fgraphql-js).\n\nSupports: queries, mutations & subscriptions.\n\n### Documentation\n\ngodoc: https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql\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:\u002F\u002Fgithub.com\u002Fsogko) | Not available yet. |\n| [Chris Ramón](https:\u002F\u002Fgithub.com\u002Fchris-ramon) | https:\u002F\u002Fwww.paypal.com\u002Fdonate\u002F?hosted_button_id=WHUQQYEMTRQBJ |\n\n### Getting Started\n\nTo install the library, run:\n```bash\ngo get github.com\u002Fgraphql-go\u002Fgraphql\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\u002Fjson\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com\u002Fgraphql-go\u002Fgraphql\"\n)\n\nfunc main() {\n\t\u002F\u002F Schema\n\tfields := graphql.Fields{\n\t\t\"hello\": &graphql.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\u002F\u002F 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) > 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) \u002F\u002F {\"data\":{\"hello\":\"world\"}}\n}\n```\nFor more complex examples, refer to the [examples\u002F](https:\u002F\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql\u002Ftree\u002Fmaster\u002Fexamples\u002F) directory and [graphql_test.go](https:\u002F\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql\u002Fblob\u002Fmaster\u002Fgraphql_test.go).\n\n### Third Party Libraries\n| Name          | Author        | Description  |\n|:-------------:|:-------------:|:------------:|\n| [graphql-go-handler](https:\u002F\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql-go-handler) | [Hafiz Ismail](https:\u002F\u002Fgithub.com\u002Fsogko) | Middleware to handle GraphQL queries through HTTP requests. |\n| [graphql-relay-go](https:\u002F\u002Fgithub.com\u002Fgraphql-go\u002Fgraphql-relay-go) | [Hafiz Ismail](https:\u002F\u002Fgithub.com\u002Fsogko) | Lib to construct a graphql-go server supporting react-relay. |\n| [golang-relay-starter-kit](https:\u002F\u002Fgithub.com\u002Fsogko\u002Fgolang-relay-starter-kit) | [Hafiz Ismail](https:\u002F\u002Fgithub.com\u002Fsogko) | Barebones starting point for a Relay application with Golang GraphQL server. |\n| [dataloader](https:\u002F\u002Fgithub.com\u002Fnicksrandall\u002Fdataloader) | [Nick Randall](https:\u002F\u002Fgithub.com\u002Fnicksrandall) | [DataLoader](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fdataloader) implementation in Go. |\n\n### Blog Posts\n- [Golang + GraphQL + Relay](https:\u002F\u002Fwehavefaces.net\u002Flearn-golang-graphql-relay-1-e59ea174a902)\n\n","graphql-go\u002Fgraphql 是一个为 Go 语言实现的 GraphQL 库。它支持查询、变更和订阅，遵循官方的 JavaScript 参考实现 graphql-js，并且提供了完整的文档和测试覆盖。该项目适用于需要在 Go 项目中集成 GraphQL API 的场景，尤其是当应用需要提供灵活的数据获取方式时。通过这个库，开发者可以轻松定义模式、解析器并执行 GraphQL 查询，从而构建出高效且功能丰富的数据层。此外，项目还鼓励社区贡献，以持续改进其对 Go 生态的支持。","2026-06-11 03:02:17","top_language"]