gqlgen
gqlgen.com
- Free plan
- Self-hosted
What gqlgen is
gqlgen is a free Go library for building GraphQL servers. Developers define a schema in GraphQL Schema Definition Language, then use gqlgen to generate models and server runtime code. The project emphasizes type safety and aims to avoid a workflow built around map[string]interface{}. Its listed operations include queries, mutations, subscriptions, and federation. Developers can bind schema types to custom Go models and generate explicit field resolvers. Documentation recipes cover Apollo Federation, authentication, CORS, Gin, and subscriptions; the authentication approach passes details through context. The getting-started guide runs a generated server with go run server.go and opens it at localhost:8080. The library includes project scaffolding, custom templates, schema-to-code generation, and a CLI. It is self-hosted, and Go is its supported language and server language. Bugs or unexpected behavior can be reported through GitHub issues. One configuration restriction is that user-configurable directives are not supported for scalar, enum, interface, or union types.
Who it suits
gqlgen suits Go developers building GraphQL servers who want to generate code from a schema and use custom Go models. It is for teams comfortable with a self-hosted library and its configuration limits.
Good to know, and what to watch
- Generates models and server code from a GraphQL schema
- Supports queries, mutations, subscriptions, and federation
- Can bind schema types to custom Go models
- Includes scaffolding, custom templates, and a CLI
- No user-configurable directives for scalar types
- No user-configurable directives for enums, interfaces, or unions
Plans
Every plan and pricegqlgen
Free plan
The verdict
gqlgen provides a schema-first route to building GraphQL servers in Go, with code generation and support for common operations. Its directive restriction may matter for projects that need customization across the listed type categories.
What the maker publishes
- Approach
- It uses a schema-first approach based on GraphQL Schema Definition Language. source
- Code generation
- gqlgen generates code from a GraphQL schema, including models and server runtime code. source
- Custom models
- The getting-started guide shows how gqlgen can bind schema types to custom Go models and generate explicit field resolvers. source
- Deployment
- The getting-started guide runs the generated server with go run server.go and opens it at localhost:8080. source
- Federation
- The feature comparison lists federation support, and the configuration documentation shows Apollo Federation enabled by default in its example configuration. source
- Integrations
- The documentation includes recipes for Apollo Federation, authentication, CORS, Gin, and subscriptions. source
- Large schemas
- The configuration documentation identifies type systems above 65,000 methods as very large and recommends function syntax for execution context as an option. source
- Notable limitation
- The configuration documentation says gqlgen does not currently support user-configurable directives for scalar, enum, interface, or union types. source
- Operations
- The feature comparison lists support for queries, mutations, and subscriptions. source
- Product
- gqlgen is a Go library for building GraphQL servers. source
- Security
- The documentation provides an authentication recipe that passes authentication details through context. source
- Support
- The project directs users who find bugs or unexpected behavior to raise an issue on GitHub. source
- Type safety
- The project prioritizes type safety and says users should not see map[string]interface{} in its workflow. source
Checked against the maker's pages on 2 Oct 2026.