gqlschemagen simplifies the process of generating GraphQL schemas from Go structs. With support for gqlgen directives, custom naming strategies, and extensive configuration options, this powerful tool adds efficiency to Go projects. Ideal for developers looking to integrate GraphQL seamlessly, it also offers a VSCode extension for a better development experience.
gqlschemagen is a powerful and flexible schema generator specifically designed for Go projects utilizing GraphQL. It analyzes Go structs to produce GraphQL schema files that seamlessly integrate with the gqlgen tool, offering features such as custom naming strategies and extensive configuration options.
@GqlNamespace directive.@goModel and @goField directives, enhancing the integration with gqlgen.@GqlExtraField, @GqlTypeExtraField, and @GqlInputExtraField directives.The GraphQL schema generator can operate in various modes, including:
gqlschemagen commands prior to executing gqlgen, ensuring the generated schemas are current before resolver generation.To generate schemas, simply run:
# Using the installed binary
# Generate schema files
gqlschemagen generate -p ./internal/domain/entities -o ./graph/schema
# Initialize configuration file
gqlschemagen init
The generator relies on a range of annotations to define which types and fields should be generated:
@GqlType: Defines a GraphQL type, with optional name and description parameters.@GqlInput: Specifies a GraphQL input type with custom naming capabilities.@GqlIgnoreAll: Excludes all fields by default unless explicitly included.Overall, gqlschemagen delivers a comprehensive solution for Go developers needing an effective way to manage and generate GraphQL schemas, enhancing both productivity and code quality.
No comments yet.
Sign in to be the first to comment.