v1.0.0 Now Available
Type-safe GraphQL
from your Go models.
Stop writing schemas by hand. Annotate your standard Go structs and generate production-ready GraphQL schemas instantly.
Declarative
Define schema using simple Go struct tags.
Zero Boilerplate
No need to maintain separate .graphql files.
Go Native
Works seamlessly with your existing domain entities.
Get started in seconds
Three simple steps to automate your schema workflow.
1
Install
Get the latest version of the CLI tool directly from standard Go modules.
$ go install github.com/pablor21/gqlschemagen@latest2
Annotate
Add the @gqlType directive to your Go structs to expose them to the schema.
internal/domain/user.go
user.go(GraphQL Type Definition)
3
Generate
Run the generator to build your GraphQL schema file automatically.
$ gqlschemagen generate -p ./internal/domain -o ./graph4
What you get?
A beatifully generated GraphQL schema file ready to use in your server!!!
graph/schema.graphqls
schema.graphqls(GraphQL Schema)
Ready to speed up development?
Join other Go developers who are automating their GraphQL workflow.
Check the Documentation