{"id":17919354,"url":"https://github.com/zombiezen/graphql-server","last_synced_at":"2025-10-26T13:48:36.155Z","repository":{"id":143367244,"uuid":"208270245","full_name":"zombiezen/graphql-server","owner":"zombiezen","description":"GraphQL server package for Go with a focus on simplicity and efficiency","archived":false,"fork":false,"pushed_at":"2020-04-17T19:35:22.000Z","size":376,"stargazers_count":26,"open_issues_count":23,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T19:42:03.536Z","etag":null,"topics":["backend","golang","graphql","graphql-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zombiezen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"zombiezen"}},"created_at":"2019-09-13T13:28:08.000Z","updated_at":"2021-07-23T05:31:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f1cecb8-ad6b-4916-9b68-d60b914dfbb1","html_url":"https://github.com/zombiezen/graphql-server","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/zombiezen/graphql-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Fgraphql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Fgraphql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Fgraphql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Fgraphql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zombiezen","download_url":"https://codeload.github.com/zombiezen/graphql-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Fgraphql-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281114864,"owners_count":26446042,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backend","golang","graphql","graphql-server"],"created_at":"2024-10-28T20:16:16.612Z","updated_at":"2025-10-26T13:48:36.118Z","avatar_url":"https://github.com/zombiezen.png","language":"Go","funding_links":["https://github.com/sponsors/zombiezen"],"categories":[],"sub_categories":[],"readme":"# @zombiezen's GraphQL Go Server\n\n[![GoDoc](https://godoc.org/zombiezen.com/go/graphql-server/graphql?status.svg)](https://godoc.org/zombiezen.com/go/graphql-server/graphql)\n\nThis repository contains Go packages for creating a [GraphQL][] server. The\nprimary focus is on simplicity and efficiency of the server endpoints.\n\n**This library is pre-1.0, so there may still be API changes.** You can find\nknown issues about [compliance to the specification][spec-compliance] or\n[production-readiness][productionization] in the issue tracker.\n\n[GraphQL]: https://graphql.org/\n[productionization]: https://github.com/zombiezen/graphql-server/labels/productionization\n[spec-compliance]: https://github.com/zombiezen/graphql-server/labels/spec-compliance\n\n## Getting Started\n\nThe easiest way to get started with this library is to follow the directions in\nthe [graphql-go-app README][] to create a project. This will set you up with a\nGraphQL server with a [Single-Page Application][] using [TypeScript][] and\n[React][].\n\nIf you want to integrate the library into an existing project, then run:\n\n```\ngo get zombiezen.com/go/graphql-server/graphql\n```\n\nThen, look at the [main package example][] for how to write a server type and\nthe [`graphqlhttp` package example][] for how to start serving over HTTP.\n\n[graphql-go-app README]: https://github.com/zombiezen/graphql-go-app/blob/master/README.md#getting-started\n[`graphqlhttp` package example]: https://godoc.org/zombiezen.com/go/graphql-server/graphqlhttp#example-package\n[main package example]: https://godoc.org/zombiezen.com/go/graphql-server/graphql#example-package\n[React]: https://reactjs.org/\n[Single-Page Application]: https://en.wikipedia.org/wiki/Single-page_application\n[TypeScript]: https://www.typescriptlang.org/\n\n## Comparison With Other Libraries\n\nA quick look at the [official GraphQL libraries for Go][] may leave you\nwondering, \"why another server library?\" Simply, @zombiezen hit roadblocks to\nwriting apps with other libraries and wanted to try a different API approach.\n\nThis library intentionally focuses on:\n\n-  using the [GraphQL interface definition language (IDL)][GraphQL IDL] to\n   define types\n-  allowing resolver functions to avoid unnecessary work by allowing inspection\n   of their [selection set][]\n-  simplifying testing by exposing a rich [value API][]\n-  permitting any serialization format, but [supporting JSON over\n   HTTP][graphqlhttp] out-of-the-box\n\n[GraphQL IDL]: https://graphql.org/learn/schema/\n[graphqlhttp]: https://godoc.org/zombiezen.com/go/graphql-server/graphqlhttp\n[official GraphQL libraries for Go]: https://graphql.org/code/#go\n[selection set]: https://godoc.org/zombiezen.com/go/graphql-server/graphql#SelectionSet\n[value API]: https://godoc.org/zombiezen.com/go/graphql-server/graphql#Value\n\n### `github.com/graphql-go/graphql`\n\n[`github.com/graphql-go/graphql`][] follows the [`graphql-js`][] reference\nimplementation, basically replicating its API verbatim. Unfortunately, this\nleads to a fairly verbose approach to defining the server's schema in code\nrather than the GraphQL IDL. Further, while you can do limited look-ahead of\noutput selection sets via [`ResolveInfo`][], this only returns the ASTs and\nrequires the caller to interpret the fragments themselves\n([graphql-go/graphql#157][]). The library also doesn't provide any\nout-of-the-box utilities for serving over HTTP.\n\n[`github.com/graphql-go/graphql`]: https://github.com/graphql-go/graphql\n[graphql-go/graphql#157]: https://github.com/graphql-go/graphql/issues/157\n[`graphql-js`]: https://github.com/graphql/graphql-js\n[`ResolveInfo`]: https://godoc.org/github.com/graphql-go/graphql#ResolveInfo\n\n### `github.com/graph-gophers/graphql-go`\n\n@zombiezen very much liked the approach that\n[`github.com/graph-gophers/graphql-go`][] took toward the problem: it uses the\nIDL and the Go type system rather than a large package-specific data structure.\nThis results in a small ramp-up time and application code that is fairly\nstraightforward to follow.\n\nHowever, the library has a few issues. It does not support look-ahead at all\n([graph-gophers/graphql-go#17][]). The API conflates schema parsing with server\nobject binding (i.e. [`graphql.ParseSchema`][] takes a resolver), so many\nservers end up passing dependencies through the `Context`. The library makes it\ndifficult to test servers that use it, since its responses are always\nJSON-formatted, which makes it hard to compare specific fields. While JSON is a\ncommon serialization format used with GraphQL, the spec permits any\nserialization.\n\n[`github.com/graph-gophers/graphql-go`]: https://github.com/graph-gophers/graphql-go\n[graph-gophers/graphql-go#17]: https://github.com/graph-gophers/graphql-go/issues/17\n[`graphql.ParseSchema`]: https://godoc.org/github.com/graph-gophers/graphql-go#ParseSchema\n\n### `github.com/99designs/gqlgen`\n\n[gqlgen][] is another common GraphQL solution for Go. Its primary selling point\nis that rather than using reflection, it generates Go code based on a GraphQL\nschema and a YAML configuration file.\n\nWhile this seems productive and helpful, @zombiezen has a [great][zombiezen protobuf]\n[deal][zombiezen wire] of [experience][go-capnproto2] with code generators and\nknows their strengths and limitations. Notably, code generators are difficult to\nreason about when generated code is mixed with user-written code. Names can\nconflict and special configuration directives are required. gqlgen is no\nexception, and while gqlgen may be productive for smaller projects, code\ngeneration provides unacceptable complexity for larger projects.\n\nOf all the other Go libraries for GraphQL @zombiezen has surveyed, gqlgen is\ndefinitely the most [feature-complete][gqlgen features], but @zombiezen found\nthese features hard to use or find due to the large API surface area dedicated\nto supporting the generated code. Further, critical features like\n[examining the selection set][gqlgen field collection] are limited to a single\nlevel of depth, whereas this library permits checking arbitrary depth.\n\nIn practice, the code someone would write for this library is largely similar to\n`gqlgen`, but with far less glue and build complexity. By performing up-front\ntype structure checks, this library is able to get many of the same guarantees\nwithout nearly as much intrusion on Go developer workflow.\n\n[go-capnproto2]: https://github.com/capnproto/go-capnproto2\n[gqlgen]: https://gqlgen.com/\n[gqlgen features]: https://gqlgen.com/feature-comparison/\n[gqlgen field collection]: https://gqlgen.com/reference/field-collection/\n[zombiezen protobuf]: https://github.com/golang/protobuf/commits?author=light@google.com\n[zombiezen wire]: https://github.com/google/wire/commits?author=zombiezen\n\n## License\n\n[Apache 2.0](https://github.com/zombiezen/graphql-server/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombiezen%2Fgraphql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzombiezen%2Fgraphql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombiezen%2Fgraphql-server/lists"}