Skip to content
  • Sponsor kobylynskyi/graphql-java-codegen

  • Notifications You must be signed in to change notification settings
  • Fork 110

Make your GraphQL Java application schema-driven.

License

Notifications You must be signed in to change notification settings

kobylynskyi/graphql-java-codegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Bogdan Kobylynskyi
Mar 4, 2024
a18ed9b · Mar 4, 2024
Feb 3, 2024
Mar 11, 2021
Feb 24, 2024
Mar 30, 2023
Mar 4, 2024
Mar 13, 2021
Feb 24, 2024
Mar 19, 2023
Dec 10, 2020
May 11, 2023
Aug 27, 2019
Jan 5, 2024
Jun 20, 2020
Mar 4, 2024
Apr 7, 2020
Apr 6, 2021
Apr 6, 2021

Repository files navigation

GraphQL Codegen

Donate

Build Discussions License: MIT

Sonarcloud Status SonarCloud Coverage SonarCloud Bugs SonarCloud Vulnerabilities

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

Supported plugins

Contributing

Please see CONTRIBUTING.md.

Inspired by

swagger-codegen

Sponsor this project

Contributors 48