https://github.com/kobylynskyi/graphql-java-codegen
Make your GraphQL Java application schema-driven.
https://github.com/kobylynskyi/graphql-java-codegen
codegen graphql graphql-codegen graphql-gradle graphql-java graphql-kotlin graphql-maven graphql-scala
Last synced: 3 months ago
JSON representation
Make your GraphQL Java application schema-driven.
- Host: GitHub
- URL: https://github.com/kobylynskyi/graphql-java-codegen
- Owner: kobylynskyi
- License: mit
- Created: 2019-08-27T17:21:52.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T16:54:52.000Z (10 months ago)
- Last Synced: 2025-03-28T06:10:16.261Z (3 months ago)
- Topics: codegen, graphql, graphql-codegen, graphql-gradle, graphql-java, graphql-kotlin, graphql-maven, graphql-scala
- Language: Java
- Homepage: https://kobylynskyi.github.io/graphql-java-codegen/
- Size: 3.13 MB
- Stars: 283
- Watchers: 7
- Forks: 110
- Open Issues: 80
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# GraphQL Codegen #
[](https://send.monobank.ua/jar/2bpWyBqBp3)

[](https://github.com/kobylynskyi/graphql-java-codegen/discussions)
[](https://opensource.org/licenses/MIT)[](https://sonarcloud.io/dashboard?id=kobylynskyi_graphql-java-codegen)
[](https://sonarcloud.io/component_measures/metric/coverage/list?id=kobylynskyi_graphql-java-codegen)
[](https://sonarcloud.io/component_measures/metric/reliability_rating/list?id=kobylynskyi_graphql-java-codegen)
[](https://sonarcloud.io/component_measures/metric/security_rating/list?id=kobylynskyi_graphql-java-codegen)GraphQL Java Codegen makes it easy to make your Java application to follow a schema-first approach whether it is a server or client application.
Following classes can be generated based on your GraphQL schema:
* Interfaces for GraphQL queries, mutations and subscriptions.
* Interfaces for GraphQL unions.
* POJO classes for GraphQL types and inputs.
* Enum classes for GraphQL enums.
* Interfaces for GraphQL type fields (e.g. for parametrized fields) aka "Resolvers".
* Client Request classes for GraphQL queries, mutations and subscriptions.## Features
* Generate classes in Java, Kotlin or Scala.
* Recursive schemas lookup by file name pattern.
* Generate code based on GraphQL schema or GraphQL Query Introspection Result.
* Generate POJOs with or without: Builder pattern, immutable fields, `toString()`, `equals()` and `hashCode()`, etc.
* Flexible API interfaces naming conventions (based on schema file name, folder name, etc.)
* Custom java package names for model and API classes.
* Custom prefix/suffix for model, API, type resolver, request, response classes.
* Custom annotations for generated classes (e.g.: validation annotations for generated model classes or specific type fields, annotations for GraphQL directives, etc.)
* Relay support.
* Ability to define codegen configuration via external json file.**For the full list of codegen configs please refer to: [Codegen Options](docs/codegen-options.md)**
## Supported plugins
* Gradle plugin: [graphql-java-codegen-gradle-plugin](plugins/gradle)
* Maven plugin: [grapqhl-java-codegen-maven-plugin](plugins/maven)
* SBT plugin: [grapqhl-java-codegen-sbt-plugin](plugins/sbt)## Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
## Inspired by
[swagger-codegen](https://github.com/swagger-api/swagger-codegen)