Git Product home page Git Product logo

graphqlcodegen's Introduction

graphqlcodegen-maven-plugin

This maven plugin is a port of the netflix codegen plugin for Gradle. Found here.

Contributing

GitHub Issue

Feel free to simply create a GitHub issue for requests to integrate with newer releases of the core DGS Codegen library.

PRs

PRS are welcome as well. The level of difficulty across DGS Codgen updates varies. Typically we add new plugin options and update the CodeGenConfig constructor - when new options are added to the Codegen core library.

Please make sure you run step 2 below to ensure your PR builds correctly. You may need to analyze the CodeGenConfig ctor parameters and add support for new options. Make sure to document any new options to the Options section below.

Process:

  1. bump the version in pom.xml
  2. run mvn install locally to ensure the project still builds
  3. Adjust CodeGen to support new options if needed.

Overview

The DGS Code Generation plugin generates code for basic types and example data fetchers based on your Domain Graph Service's graphql schema file during the project's build process. The plugin requires the designated packageName for file generation. If no schemaPath is specified, it will look in the src/main/resources/schema folder for any files with .graphqls extension.

Example Repo

https://github.com/deweyjose/graphqlcodegen-example

Options

Options are configured in the <configuration> element of the dgs-codegen-maven-plugin plugin.

onlyGenerateChanged

This options enables the plugin to limit code generation to only schema files that have changed. Today this only works with schemaPaths.

This only works for <schemaPaths>. A subsequent release for schema compilation via dependencies will be release soon.

  • Type: boolean
  • Required: false
  • Default: true
<onlyGenerateChanged>true</onlyGenerateChanged>

subPackageNameDocs

  • Type: string
  • Required: false
  • Default: docs

Example

<subPackageNameDocs>docs</subPackageNameDocs>

generateDocs

  • Type: string
  • Required: false
  • Default: docs

Example

<generateDocs>true</generateDocs>

generatedDocsFolder

  • Type: string
  • Required: false
  • Default: ./generated-docs

Example

<generatedDocsFolder>true</generatedDocsFolder>

addGeneratedAnnotation

  • Type: boolean
  • Required: false
  • Default: false

Example

<addGeneratedAnnotation>true</addGeneratedAnnotation>

skip

  • Type: boolean
  • Required: false
  • Default: false

Example

<dgs.codegen.skip>true</dgs.codegen.skip>

Or

# mvn ... -Ddgs.codegen.skip=true

schemaPaths

  • Type: array
  • Required: false
  • Default: ${project.build.resources}/schema

Example

<schemaPaths>
    <param>src/main/resources/schema/schema.graphqls1</param>
    <param>src/main/resources/schema/schema.graphqls2</param>
</schemaPaths>

schemaJarFilesFromDependencies

Example

<schemaJarFilesFromDependencies>
    <param>com.netflix.graphql.dgs:some-dependency:1.0.0</param>
    <param>com.netflix.graphql.dgs:some-dependency:X.X.X</param>
</schemaJarFilesFromDependencies>

packageName

  • Type: string
  • Required: true

Example

<packageName>com.acme.se.generated</packageName>

typeMapping

  • Type: map
  • Required: false

Example

<typeMapping>
    <Date>java.time.LocalDateTime</Date>
</typeMapping>

typeMappingPropertiesFiles

Provide typeMapping as properties file(s) that is accessible as a compile-time-classpath resource Key-Value pairs in the properties file will be added to typeMapping Map when it is not already present in it

When a same GraphQL type is present in both typeMapping and also in typeMappingPropertiesFiles, value in typeMapping will be used (and the value from typeMappingPropertiesFiles will be ignored)

  • Type: Array
  • Required: false

Example

<typeMappingPropertiesFiles>
    <typeMappingPropertiesFile>commontypes-typeMapping.properties</typeMappingPropertiesFile>
    <typeMappingPropertiesFile>someother-commontypes-typeMapping.properties</typeMappingPropertiesFile>
</typeMappingPropertiesFiles>

subPackageNameClient

  • Type: string
  • Required: false
  • Default: client

Example

<subPackageNameClient>client</subPackageNameClient>

subPackageNameDatafetchers

  • Type: string
  • Required: false
  • Default: client

Example

<subPackageNameDatafetchers>datafetchers</subPackageNameDatafetchers>

subPackageNameTypes

  • Type: string
  • Required: false
  • Default: client

Example

<subPackageNameTypes>types</subPackageNameTypes>

generateBoxedTypes

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateBoxedTypes>false</generateBoxedTypes>

generateClientApi

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateClientApi>false</generateClientApi>

generateClientApiV2

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateClientApiV2>false</generateClientApiV2>

generateInterfaces

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateInterfaces>false</generateInterfaces>

generateKotlinNullableClasses

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateKotlinNullableClasses>false</generateKotlinNullableClasses>

generateKotlinClosureProjections

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateKotlinClosureProjections>false</generateKotlinClosureProjections>

outputDir

  • Type: string
  • Required: false
  • Default: ${project.basedir}/target/generated-sources

Example:

<outputDir>${project.build.directory}/generated-sources</outputDir>

exampleOutputDir

  • Type: string
  • Required: false
  • Default: ${project.basedir}/target/generated-examples

Example:

<outputDir>${project.build.directory}/generated-examples</outputDir>

includeQueries

  • Description: Limit generation to specified set of queries. Used in conjunction with generateClient.
  • Type: array
  • Required: false
  • Default: []

Example

<includeQueries>
    <param>QueryFieldName1</param>
    <param>QueryFieldName2</param>
</includeQueries>

includeMutations

  • Description: Limit generation to specified set of mutations. Used in conjunction with generateClient.
  • Type: array
  • Required: false
  • Default: []

Example

<includeMutations>
    <param>MutationFieldName1</param>
    <param>MutationFieldName1</param>
</includeMutations>

skipEntityQueries

  • Type: boolean
  • Required: false
  • Default: false

Example

<skipEntityQueries>false</skipEntityQueries>

shortProjectionNames

  • Type: boolean
  • Required: false
  • Default: false

Example

<shortProjectionNames>false</shortProjectionNames>

generateDataTypes

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateDataTypes>false</generateDataTypes>

maxProjectionDepth

  • Type: int
  • Required: false
  • Default: 10

Example

<maxProjectionDepth>10</maxProjectionDepth>

language

  • Type: String
  • Required: false
  • Default: java

Example

<language>kotlin</language>

omitNullInputFields

  • Type: boolean
  • Required: false
  • Default: false

Example

<omitNullInputFields>false</omitNullInputFields>

kotlinAllFieldsOptional

  • Type: boolean
  • Required: false
  • Default: false

Example

<kotlinAllFieldsOptional>false</kotlinAllFieldsOptional>

snakeCaseConstantNames

  • Type: boolean
  • Required: false
  • Default: false

Example

<snakeCaseConstantNames>false</snakeCaseConstantNames>

writeToFiles

  • Type: boolean
  • Required: false
  • Default: true

Example

<writeToFiles>false</writeToFiles>

includeSubscriptions

  • Type: array
  • Required: false
  • Default: []

Example

<includeSubscriptions>
    <param>Subscriptions1</param>
    <param>Subscriptions2</param>
</includeSubscriptions>

generateInterfaceSetters

  • Type: boolean
  • Required: false
  • Default: true

Example

<generateInterfaceSetters>false</generateInterfaceSetters>

generateInterfaceMethodsForInterfaceFields

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateInterfaceMethodsForInterfaceFields>false</generateInterfaceMethodsForInterfaceFields>

javaGenerateAllConstructor

  • Type: boolean
  • Required: false
  • Default: false

Example

<javaGenerateAllConstructor>false</javaGenerateAllConstructor>

implementSerializable

  • Type: boolean
  • Required: false
  • Default: false

Example

<implementSerializable>false</implementSerializable>

generateCustomAnnotations

  • Type: boolean
  • Required: false
  • Default: false
<generateCustomAnnotations>false</generateCustomAnnotations>

addDeprecatedAnnotation

  • Type: boolean
  • Required: false
  • Default: false
<addDeprecatedAnnotation>false</addDeprecatedAnnotation>

includeImports

  • Type: map<string, string>
  • Required: false
<includeImports>
    <validator>com.test.validator</validator>
</includeImports>

includeEnumImports

  • Type: map<string,<string,string>>
  • Required: false
<includeEnumImports>
    <foo>
        <properties>
            <bar>bla</bar>
        </properties>
    </foo>
    <bar>
        <properties>
            <zoo>bar.bar</zoo>
            <zing>bla.bla</zing>
        </properties>
    </bar>
</includeEnumImports>

includeClassImports

Maps the custom annotation and class names to the class packages. Only used when generateCustomAnnotations is enabled.

  • Type
  • Required: false
<includeClassImports>
    <foo>
        <properties>
            <bar>bla</bar>
        </properties>
    </foo>
    <bar>
        <properties>
            <zoo>bar.bar</zoo>

            <zing>bla.bla</zing>
        </properties>
    </bar>
</includeClassImports>

generateIsGetterForPrimitiveBooleanFields

  • Type: boolean
  • Required: false
  • Default: false

Example

<generateIsGetterForPrimitiveBooleanFields>false</generateIsGetterForPrimitiveBooleanFields>

Usage

Add the following to your pom files build/plugins section.

<plugin>
    <groupId>io.github.deweyjose</groupId>
    <artifactId>graphqlcodegen-maven-plugin</artifactId>
    <version>1.24</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <schemaPaths>
            <param>src/main/resources/schema/schema.graphqls</param>
        </schemaPaths>
        <packageName>com.acme.[your_project].generated</packageName>
        <addGeneratedAnnotation>true</addGeneratedAnnotation>
    </configuration>
</plugin>

You'll also need to add the generates-sources folder to the classpath:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>${project.build.directory}/generated-sources</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>

Generated Output

COPIED FROM NETFLIX DOCUMENTATION.

The generated types are available as part of the packageName.types package under build/generated. These are automatically added to your project's sources. The generated example data fetchers are available under build/generated-examples. Note that these are NOT added to your project's sources and serve mainly as a basic boilerplate code requiring further customization.

graphqlcodegen's People

Contributors

achekroun avatar alexriedler avatar dependabot[bot] avatar deweyjose avatar karhig avatar lakshmisunid avatar lukasdo avatar ramapalani avatar sdoxsee avatar zorglube avatar zwolsman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graphqlcodegen's Issues

Include Class Imports and custom annoations

I could not get this to work wit the maven plugin. The class always remained as a string in the built annotation. Enums worked fine.

Example with Class Object:

Since GraphQL parser does not have built-in support for class objects, a class is represented as a string ending with ".class" in the schema

type Person @Annotate(name: "ValidPerson", type: "validator", inputs: {groups: "BasicValidation.class"}) {
name: String @Annotate(name: "com.test.anotherValidator.ValidName")
}

Duplicate entries in schemaPaths

image

Throws [ERROR] Failed to execute goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.29:generate (default) on project ***: Execution default of goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.29:generate failed: Duplicate entries in schemaPaths -> [Help 1]

Upgrading to `1.11` results in generated sources to be `Java` files, even though `Kotlin` is configured

Hey,

Thanks for maintaining this maven plugin!

when updating the library to version 1.11 from 1.10, the generated sources end up being Java sources, even though Kotlin has been configured as the output language, by using the following configuration property:

<language>kotlin</language>

This is stopping me from upgrading the library, which in turn is blocking me in upgrading the DGS Framework to 4.5.x.

I presume this has something to do with the graphql-dgs-codegen-core version bump to 5.0.3 in this PR #8 .

Perhaps the language configuration param is no longer being passed correctly?

Thanks!

Add `maven-release-plugin`

In order to help the release cycle and version number generation, using maven-release-plugin seems interesting

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <scmCommentPrefix>[skip ci] [maven-release-plugin]</scmCommentPrefix>
                    <username>${USER}</username>
                    <password>${PASSWORD}</password>
                    <detail>true</detail>
                </configuration>
            </plugin>
        </plugins>
    </build>

Is this repo abandoned?

Hi @deweyjose. We are looking into using this plugin and want to make some modifications, but as I see there is no activity from the maintainer's side, so is this repo still maintained or should we create a fork instead?

TypeMapping with generics

The TypeMapping assumes that the import and usage are the same, leading to incorrect code generation when using generics.

<plugin>
                <groupId>io.github.deweyjose</groupId>
                <artifactId>graphqlcodegen-maven-plugin</artifactId>
                <version>1.11</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>com.xxx.ui.nakamura.client</packageName>
                    <schemaPaths>
                        <param>src/main/resources/graphql/nakamura/schema.graphql</param>
                    </schemaPaths>
                    <typeMapping>
                        <ObjectScalar>java.lang.Object</ObjectScalar>
                        <UUID>java.util.UUID</UUID>
                        <Map_String_ObjectScalar >java.util.Map&lt;String, Object&gt;</Map_String_ObjectScalar>
                        <Map_String_StringScalar>java.util.Map&lt;String, String&gt;</Map_String_StringScalar>
                    </typeMapping>
                </configuration>
</plugin>

will generate

import java.util.Map<String, String>;

and

private Map<String, String> states;

Is this also the case for the Netflix gradle implementation?


For now I'm am using the unqualified java.util.Map and will have to cast it at some later point.

Reported maven plugin issues

Hello. Recently I get warning with some plugins. Here are those yours generate:

[WARNING]  * io.github.deweyjose:graphqlcodegen-maven-plugin:1.38
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin is a Maven 2.x plugin, which will be not supported in Maven 4.x
[WARNING]    * Plugin mixes multiple Maven versions: [3.8.1, 2.2.1]
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-plugin-api:3.8.1, org.apache.maven:maven-artifact:3.8.1, org.apache.maven:maven-model:3.8.1]
[WARNING]    * Plugin depends on plexus-container-default, which is EOL
[WARNING] 
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]

Generation failed with ClassNotFound com/squareup/kotlinpoet/TypeNames

Using this as configuration:

<plugin>
    <groupId>io.github.deweyjose</groupId>
    <artifactId>graphqlcodegen-maven-plugin</artifactId>
    <version>1.51.1</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <language>kotlin</language>
        <schemaPaths>
            <param>src/main/resources/schema/</param>
        </schemaPaths>
        <packageName>com.example.demo</packageName>
        <typeMapping>
            <BigDecimal>java.math.BigDecimal</BigDecimal>
        </typeMapping>
        <addGeneratedAnnotation>true</addGeneratedAnnotation>
        <addDeprecatedAnnotation>true</addDeprecatedAnnotation>
    </configuration>
</plugin>

The generation fails:

...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.022 s
[INFO] Finished at: 2024-01-05T14:56:15+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate (default) on project app: Execution default of goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate failed: A required class was missing while executing io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate: com/squareup/kotlinpoet/TypeNames
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/demo/.m2/repository/io/github/deweyjose/graphqlcodegen-maven-plugin/1.51.1/graphqlcodegen-maven-plugin-1.51.1.jar
[ERROR] urls[1] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-core/6.1.1/graphql-dgs-codegen-core-6.1.1.jar
[ERROR] urls[2] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.9.21/kotlin-stdlib-1.9.21.jar
[ERROR] urls[3] = file:/Users/demo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar
[ERROR] urls[4] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-shared-core/6.1.1/graphql-dgs-codegen-shared-core-6.1.1.jar
[ERROR] urls[5] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.9.21/kotlin-reflect-1.9.21.jar
[ERROR] urls[6] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/graphql-dgs/5.5.1/graphql-dgs-5.5.1.jar
[ERROR] urls[7] = file:/Users/demo/.m2/repository/com/graphql-java/graphql-java/19.2/graphql-java-19.2.jar
[ERROR] urls[8] = file:/Users/demo/.m2/repository/com/graphql-java/java-dataloader/3.2.0/java-dataloader-3.2.0.jar
[ERROR] urls[9] = file:/Users/demo/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
[ERROR] urls[10] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.4/jackson-annotations-2.13.4.jar
[ERROR] urls[11] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.4/jackson-databind-2.13.4.jar
[ERROR] urls[12] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.4/jackson-core-2.13.4.jar
[ERROR] urls[13] = file:/Users/demo/.m2/repository/com/squareup/javapoet/1.13.0/javapoet-1.13.0.jar
[ERROR] urls[14] = file:/Users/demo/.m2/repository/com/squareup/kotlinpoet/1.15.3/kotlinpoet-1.15.3.jar
[ERROR] urls[15] = file:/Users/demo/.m2/repository/com/github/ajalt/clikt/clikt/4.2.1/clikt-4.2.1.jar
[ERROR] urls[16] = file:/Users/demo/.m2/repository/com/github/ajalt/mordant/mordant/2.2.0/mordant-2.2.0.jar
[ERROR] urls[17] = file:/Users/demo/.m2/repository/com/github/ajalt/colormath/colormath/3.3.1/colormath-3.3.1.jar
[ERROR] urls[18] = file:/Users/demo/.m2/repository/org/jetbrains/markdown/0.5.2/markdown-0.5.2.jar
[ERROR] urls[19] = file:/Users/demo/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar
[ERROR] urls[20] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar
[ERROR] urls[21] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json/1.6.2/kotlinx-serialization-json-1.6.2.jar
[ERROR] urls[22] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.6.2/kotlinx-serialization-json-jvm-1.6.2.jar
[ERROR] urls[23] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-core-jvm/1.6.2/kotlinx-serialization-core-jvm-1.6.2.jar
[ERROR] urls[24] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar
[ERROR] urls[25] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-core/1.4.14/logback-core-1.4.14.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : com.squareup.kotlinpoet.TypeNames
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate (default) on project app: Execution default of goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate failed: A required class was missing while executing io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate: com/squareup/kotlinpoet/TypeNames
-----------------------------------------------------
realm =    plugin>io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/demo/.m2/repository/io/github/deweyjose/graphqlcodegen-maven-plugin/1.51.1/graphqlcodegen-maven-plugin-1.51.1.jar
urls[1] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-core/6.1.1/graphql-dgs-codegen-core-6.1.1.jar
urls[2] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.9.21/kotlin-stdlib-1.9.21.jar
urls[3] = file:/Users/demo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar
urls[4] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-shared-core/6.1.1/graphql-dgs-codegen-shared-core-6.1.1.jar
urls[5] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.9.21/kotlin-reflect-1.9.21.jar
urls[6] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/graphql-dgs/5.5.1/graphql-dgs-5.5.1.jar
urls[7] = file:/Users/demo/.m2/repository/com/graphql-java/graphql-java/19.2/graphql-java-19.2.jar
urls[8] = file:/Users/demo/.m2/repository/com/graphql-java/java-dataloader/3.2.0/java-dataloader-3.2.0.jar
urls[9] = file:/Users/demo/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
urls[10] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.4/jackson-annotations-2.13.4.jar
urls[11] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.4/jackson-databind-2.13.4.jar
urls[12] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.4/jackson-core-2.13.4.jar
urls[13] = file:/Users/demo/.m2/repository/com/squareup/javapoet/1.13.0/javapoet-1.13.0.jar
urls[14] = file:/Users/demo/.m2/repository/com/squareup/kotlinpoet/1.15.3/kotlinpoet-1.15.3.jar
urls[15] = file:/Users/demo/.m2/repository/com/github/ajalt/clikt/clikt/4.2.1/clikt-4.2.1.jar
urls[16] = file:/Users/demo/.m2/repository/com/github/ajalt/mordant/mordant/2.2.0/mordant-2.2.0.jar
urls[17] = file:/Users/demo/.m2/repository/com/github/ajalt/colormath/colormath/3.3.1/colormath-3.3.1.jar
urls[18] = file:/Users/demo/.m2/repository/org/jetbrains/markdown/0.5.2/markdown-0.5.2.jar
urls[19] = file:/Users/demo/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar
urls[20] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar
urls[21] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json/1.6.2/kotlinx-serialization-json-1.6.2.jar
urls[22] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.6.2/kotlinx-serialization-json-jvm-1.6.2.jar
urls[23] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-core-jvm/1.6.2/kotlinx-serialization-core-jvm-1.6.2.jar
urls[24] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar
urls[25] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-core/1.4.14/logback-core-1.4.14.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate failed: A required class was missing while executing io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate: com/squareup/kotlinpoet/TypeNames
-----------------------------------------------------
realm =    plugin>io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/demo/.m2/repository/io/github/deweyjose/graphqlcodegen-maven-plugin/1.51.1/graphqlcodegen-maven-plugin-1.51.1.jar
urls[1] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-core/6.1.1/graphql-dgs-codegen-core-6.1.1.jar
urls[2] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.9.21/kotlin-stdlib-1.9.21.jar
urls[3] = file:/Users/demo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar
urls[4] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-shared-core/6.1.1/graphql-dgs-codegen-shared-core-6.1.1.jar
urls[5] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.9.21/kotlin-reflect-1.9.21.jar
urls[6] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/graphql-dgs/5.5.1/graphql-dgs-5.5.1.jar
urls[7] = file:/Users/demo/.m2/repository/com/graphql-java/graphql-java/19.2/graphql-java-19.2.jar
urls[8] = file:/Users/demo/.m2/repository/com/graphql-java/java-dataloader/3.2.0/java-dataloader-3.2.0.jar
urls[9] = file:/Users/demo/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
urls[10] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.4/jackson-annotations-2.13.4.jar
urls[11] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.4/jackson-databind-2.13.4.jar
urls[12] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.4/jackson-core-2.13.4.jar
urls[13] = file:/Users/demo/.m2/repository/com/squareup/javapoet/1.13.0/javapoet-1.13.0.jar
urls[14] = file:/Users/demo/.m2/repository/com/squareup/kotlinpoet/1.15.3/kotlinpoet-1.15.3.jar
urls[15] = file:/Users/demo/.m2/repository/com/github/ajalt/clikt/clikt/4.2.1/clikt-4.2.1.jar
urls[16] = file:/Users/demo/.m2/repository/com/github/ajalt/mordant/mordant/2.2.0/mordant-2.2.0.jar
urls[17] = file:/Users/demo/.m2/repository/com/github/ajalt/colormath/colormath/3.3.1/colormath-3.3.1.jar
urls[18] = file:/Users/demo/.m2/repository/org/jetbrains/markdown/0.5.2/markdown-0.5.2.jar
urls[19] = file:/Users/demo/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar
urls[20] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar
urls[21] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json/1.6.2/kotlinx-serialization-json-1.6.2.jar
urls[22] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.6.2/kotlinx-serialization-json-jvm-1.6.2.jar
urls[23] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-core-jvm/1.6.2/kotlinx-serialization-core-jvm-1.6.2.jar
urls[24] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar
urls[25] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-core/1.4.14/logback-core-1.4.14.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:152)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1:generate: com/squareup/kotlinpoet/TypeNames
-----------------------------------------------------
realm =    plugin>io.github.deweyjose:graphqlcodegen-maven-plugin:1.51.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/demo/.m2/repository/io/github/deweyjose/graphqlcodegen-maven-plugin/1.51.1/graphqlcodegen-maven-plugin-1.51.1.jar
urls[1] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-core/6.1.1/graphql-dgs-codegen-core-6.1.1.jar
urls[2] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.9.21/kotlin-stdlib-1.9.21.jar
urls[3] = file:/Users/demo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar
urls[4] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/codegen/graphql-dgs-codegen-shared-core/6.1.1/graphql-dgs-codegen-shared-core-6.1.1.jar
urls[5] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.9.21/kotlin-reflect-1.9.21.jar
urls[6] = file:/Users/demo/.m2/repository/com/netflix/graphql/dgs/graphql-dgs/5.5.1/graphql-dgs-5.5.1.jar
urls[7] = file:/Users/demo/.m2/repository/com/graphql-java/graphql-java/19.2/graphql-java-19.2.jar
urls[8] = file:/Users/demo/.m2/repository/com/graphql-java/java-dataloader/3.2.0/java-dataloader-3.2.0.jar
urls[9] = file:/Users/demo/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
urls[10] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.4/jackson-annotations-2.13.4.jar
urls[11] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.4/jackson-databind-2.13.4.jar
urls[12] = file:/Users/demo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.4/jackson-core-2.13.4.jar
urls[13] = file:/Users/demo/.m2/repository/com/squareup/javapoet/1.13.0/javapoet-1.13.0.jar
urls[14] = file:/Users/demo/.m2/repository/com/squareup/kotlinpoet/1.15.3/kotlinpoet-1.15.3.jar
urls[15] = file:/Users/demo/.m2/repository/com/github/ajalt/clikt/clikt/4.2.1/clikt-4.2.1.jar
urls[16] = file:/Users/demo/.m2/repository/com/github/ajalt/mordant/mordant/2.2.0/mordant-2.2.0.jar
urls[17] = file:/Users/demo/.m2/repository/com/github/ajalt/colormath/colormath/3.3.1/colormath-3.3.1.jar
urls[18] = file:/Users/demo/.m2/repository/org/jetbrains/markdown/0.5.2/markdown-0.5.2.jar
urls[19] = file:/Users/demo/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar
urls[20] = file:/Users/demo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar
urls[21] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json/1.6.2/kotlinx-serialization-json-1.6.2.jar
urls[22] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.6.2/kotlinx-serialization-json-jvm-1.6.2.jar
urls[23] = file:/Users/demo/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-core-jvm/1.6.2/kotlinx-serialization-core-jvm-1.6.2.jar
urls[24] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar
urls[25] = file:/Users/demo/.m2/repository/ch/qos/logback/logback-core/1.4.14/logback-core-1.4.14.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:150)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.NoClassDefFoundError: com/squareup/kotlinpoet/TypeNames
    at com.netflix.graphql.dgs.codegen.generators.kotlin.KotlinTypeUtils.<init> (KotlinTypeUtils.kt:38)
    at com.netflix.graphql.dgs.codegen.generators.kotlin.AbstractKotlinDataTypeGenerator.<init> (KotlinDataTypeGenerator.kt:144)
    at com.netflix.graphql.dgs.codegen.generators.kotlin.KotlinDataTypeGenerator.<init> (KotlinDataTypeGenerator.kt:49)
    at com.netflix.graphql.dgs.codegen.CodeGen$generateKotlinDataTypes$3.invoke (CodeGen.kt:432)
    at com.netflix.graphql.dgs.codegen.CodeGen$generateKotlinDataTypes$3.invoke (CodeGen.kt:430)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:210)
    at com.netflix.graphql.dgs.codegen.CodeGen.generateKotlinDataTypes (CodeGen.kt:871)
    at com.netflix.graphql.dgs.codegen.CodeGen.generateKotlin (CodeGen.kt:331)
    at com.netflix.graphql.dgs.codegen.CodeGen.generate (CodeGen.kt:73)
    at io.github.deweyjose.graphqlcodegen.Codegen.execute (Codegen.java:260)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.ClassNotFoundException: com.squareup.kotlinpoet.TypeNames
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at com.netflix.graphql.dgs.codegen.generators.kotlin.KotlinTypeUtils.<init> (KotlinTypeUtils.kt:38)
    at com.netflix.graphql.dgs.codegen.generators.kotlin.AbstractKotlinDataTypeGenerator.<init> (KotlinDataTypeGenerator.kt:144)
    at com.netflix.graphql.dgs.codegen.generators.kotlin.KotlinDataTypeGenerator.<init> (KotlinDataTypeGenerator.kt:49)
    at com.netflix.graphql.dgs.codegen.CodeGen$generateKotlinDataTypes$3.invoke (CodeGen.kt:432)
    at com.netflix.graphql.dgs.codegen.CodeGen$generateKotlinDataTypes$3.invoke (CodeGen.kt:430)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:210)
    at com.netflix.graphql.dgs.codegen.CodeGen.generateKotlinDataTypes (CodeGen.kt:871)
    at com.netflix.graphql.dgs.codegen.CodeGen.generateKotlin (CodeGen.kt:331)
    at com.netflix.graphql.dgs.codegen.CodeGen.generate (CodeGen.kt:73)
    at io.github.deweyjose.graphqlcodegen.Codegen.execute (Codegen.java:260)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
---
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

I tried adding https://mvnrepository.com/artifact/com.squareup/kotlinpoet-metadata-specs as dependency (multiple versions), but that creates other errors:

---
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.NoSuchMethodError: 'java.nio.file.Path com.squareup.kotlinpoet.FileSpec.writeTo(java.nio.file.Path)'
    at com.netflix.graphql.dgs.codegen.CodeGen.generate (CodeGen.kt:90)
    at io.github.deweyjose.graphqlcodegen.Codegen.execute (Codegen.java:260)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
---

Consider allowing to configure class name prefixes for better usage alongside mapping frameworks

Our project is currently hindered using this plugin due to the following issue: backend model classes share identical names, leading to naming conflicts and the need to rely on package names for differentiation of the Classes.

To circumvent this issue, we've adopted a strategy of prefixing all model classes with "View". Since this seems currently not possible, I propose the addition of a feature that allows adding prefixes to the classes, such as "View", during the code generation phase.

I appreciate your consideration of this feature request and am hopeful for its inclusion in a future update of the graphqlcodegen plugin.

Java class generation fails on default value objects

hello @deweyjose and thanks for the awesome maven plugin!

We recently noticed a problem with Java class generation when our schema has something like

input SomeKindOfInput {
  nestedInput: NestedInput = {enumField : ENUM_VALUE1}
}

input NestedInput {
  enumField: SomeKindOfEnum!
}

where we attempt to give a field a default value of an object that has some field value.
The generated class is not a valid java class

public class SomeKindOfInput {
  private NestedInput nestedInput = ObjectValue{objectFields=[ObjectField{name='enumField', value=EnumValue{name='ENUM_VALUE1'}}]};
} 

Multiple issues when trying to get a schema from a dependency

Hello there.

Thanks for this port. I have never been working with gradle so i'm glad to find something that works with maven.
I didn't have any troubles making this work while using a schema file that is inside my project. i.e.

<schemaPaths>
    <schemaPath>src/main/resources/schema.graphql</schemaPath>
</schemaPaths>

However, what i'd really like is to be able to pull this schema file from an external dependency. So I did the following

<plugin>
    <groupId>io.github.deweyjose</groupId>
    <artifactId>graphqlcodegen-maven-plugin</artifactId>
    <version>${graphqlcodegen-maven-plugin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <schemaJarFilesFromDependencies>
            <param>groupId:artifactId:${artifact.version}</param>
        </schemaJarFilesFromDependencies>
        <language>kotlin</language>
        <packageName>my.kotlin.client</packageName>
        <generateClientApiV2>true</generateClientApiV2>
        <addGeneratedAnnotation>true</addGeneratedAnnotation>
        <!-- Needed to deserialize responses for which you haven't asked all non-optional fields -->
        <kotlinAllFieldsOptional>true</kotlinAllFieldsOptional>
        <typeMapping>
            <BigDecimal>java.math.BigDecimal</BigDecimal>
        </typeMapping>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>groupId</groupId>
            <artifactId>artifactId</artifactId>
            <version>${artifact.version}</version>
            <exclusions>
                <!-- We don't need transitive dependencies, we're only interested in the schema -->
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>

The thing is that I get the following error:

Execution default of goal io.github.deweyjose:graphqlcodegen-maven-plugin:1.30:generate failed: Duplicate entries in schemaPaths

If I activate the debug logs I see the following parameter

[DEBUG]   (f) schemaJarFilesFromDependencies = [/project/root/groupId:artifactId:1.0.0]
[DEBUG]   (f) schemaPaths = [/project/root/[Resource {targetPath: null, /project/root/ filtering: true, /project/root/ FileSet {directory: /project/root/src/main/resources, /project/root/ PatternSet [includes: {**/application*.yml, /project/root/ **/application*.yaml, /project/root/ **/application*.properties}, /project/root/ excludes: {}]}}, /project/root/ Resource {targetPath: null, /project/root/ filtering: false, /project/root/ FileSet {directory: /project/root/src/main/resources, /project/root/ PatternSet [includes: {}, /project/root/ excludes: {**/application*.yml, /project/root/ **/application*.yaml, /project/root/ **/application*.properties}]}}]/schema]

2 things strike me here:

  1. The schemaJarFilesFromDependencies doesn't look like it points to anything that can actually exist
  2. The schemaPaths seems to have defaulted to some kind of file matching and added my project's root on each new line. Here is another view fo it:
[/project/root/[Resource {targetPath: null,
 /project/root/ filtering: true,
 /project/root/ FileSet {directory: /project/root/src/main/resources, 
 /project/root/ PatternSet [includes: {**/application*.yml, 
 /project/root/ **/application*.yaml, 
 /project/root/ **/application*.properties}, 
 /project/root/ excludes: {}]}}, 
 /project/root/ Resource {targetPath: null, 
 /project/root/ filtering: false, 
 /project/root/ FileSet {directory: /project/root/src/main/resources, 
 /project/root/ PatternSet [includes: {}, 
 /project/root/ excludes: {**/application*.yml, 
 /project/root/ **/application*.yaml,
 /project/root/ **/application*.properties}]}}]/schema
 ]

So I added a dummy schema to my project combining both:

<schemaJarFilesFromDependencies>
    <param>groupId:artifactId:${artifact.version}</param>
</schemaJarFilesFromDependencies>
<schemaPaths>
    <schemaPath>src/main/resources/schema.graphql</schemaPath>
</schemaPaths>

But then I get

java.nio.file.NoSuchFileException: /project/root/groupId:artifactId:1.0.0

Am I doing something wrong here ?

Central Repo

Thank you to have written the maven plugin for the code generation, can you tell me how to use it since it is not available on maven central repo ?

Projection classes generate invalid constructors

The projection classes in my project generated a class using an extra argument that the parent class does not need

public class Shows_FooProjection extends BaseSubProjectionNode<ShowsProjectionRoot, ShowsProjectionRoot> {
  public Shows_FooProjection(ShowsProjectionRoot parent, ShowsProjectionRoot root) {
    super(parent, root, java.util.Optional.of("Foo"));
  }
}

This is from the example repository, the optional foo is marked as an error.

Support for 6.0.1

There is a new major release 6.0.0 and the latest version is 6.0.1. Is this supported?

Wildcard for specifying schema files

Using wildcard does not work. The use case is .json files exist in somefolder and want to exlude them.

<schemaPaths>
    <param>somefolder/*.graphqls</param>
</schemaPaths>

The Parameter "generateInterfaceSetters" does not seem to work

Description

I have encountered an issue where the generateInterfaceSetters parameter ( <generateInterfaceSetters>true</generateInterfaceSetters>) does not seem to be working as intended. Despite setting this parameter in my configuration, the expected interface setters are not being generated in the output.

Expected Behaviour

When the generateInterfaceSetters parameter is set to true, I expect the generated code to include setter methods in the interfaces.

Actual Behaviour

The generated code does not include the expected setter methods in interfaces, despite the generateInterfaceSetters parameter being set to true.

Maintainer

@deweyjose Is this possible for me to ask for me to be granted as maintainer (or the right status) to be able to produce new releases, through GitHub, in order to follow dgs-codegen release rythm.

generateClient Fails when Query isn't named Query

First, thanks for bringing this to Maven, my team and I appreciate it.

I'm new to graphQL, graphqlcodegen, and DGS in general, so my apologies if this is a stupid question.

I'm currently using this maven plugin in a project and failing to have client code generated unless I edit the schema. This is my configuration and a sample of the lines involved in the schema:

<plugin>
		<groupId>io.github.deweyjose</groupId>
		<artifactId>graphqlcodegen-maven-plugin</artifactId>
		<version>1.16</version>
		<executions>
			<execution>
				<goals>
					<goal>generate</goal>
				</goals>
			</execution>
		</executions>
		<configuration>
			<outputDir>${project.build.directory}/generated-sources/gql-sources</outputDir>
			<exampleOutputDir>${project.build.directory}/generated-examples/gql-examples</exampleOutputDir>
			<generateClient>true</generateClient>
			<generateBoxedTypes>true</generateBoxedTypes>
			<generateDataTypes>true</generateDataTypes>
			<writeToFiles>true</writeToFiles>
			<maxProjectionDepth>2</maxProjectionDepth>
			<typeMapping>
				<customerEffectiveDate>java.time.LocalDate</customerEffectiveDate>
				<customerEndDate>java.time.LocalDate</customerEndDate>
			</typeMapping>
			<schemaPaths>
				<param>src/main/resources/schema/graphqlapi.graphqls</param>
			</schemaPaths>
			<packageName>org.myapp.generated</packageName>
		</configuration>
</plugin>
schema {
  query: QueryRoot
}

...

type QueryRoot {
  customers(id: String, emailAlias: String, phoneNumber: String): [Customer]
  bookOfTheDead(bookId: String, bookCode: String): BookOfTheDead
}

If I refactor "QueryRoot" to "Query" in the schema, the client codegen suddenly notices the queries and generates all the expected Query and Projection classes as expected. Is the Schema I'm using non-standard? Am I missing a feature in the plugin, or is this really a bug?

Add option to skip generation

An option like -Ddgs.codegen.skip would be useful for build pipelines, to avoid repeating earlier work in later stages.

Please add a LICENSE file

Legally, without specifying a license for use, anyone who uses this code is liable (at least in the US). The Netflix code you've adapted this from uses Apache 2.0. Could you assign this as well?

typeMapping does not seem to be working

Hi,

I'm trying to ignore a type in code generation, and for some reason the plugin (or the dgs codegen) is not ignoring it. Am I configuring it right?

My schema looks like this:

type Query {
    corporateInfo(filter: String!): ClientQL
}

type ClientQL {
    properties: [CustomPropertyQL]
}

type CustomPropertyQL {
    property1: String
}

and the plugin configuration looks like this:

<configuration>
    <packageName>${project.groupId}.${project.artifactId}.graphql</packageName>
    <schemaPaths>
        <path>src/main/resources/schema/schema.graphqls</path>
    </schemaPaths>
    <generateBoxedTypes>true</generateBoxedTypes>
    <outputDir>${project.build.directory}/generated-sources/src/main/java</outputDir>
    <typeMapping>
        <CustomPropertyQL>${project.groupId}.${project.artifactId}.graphql.CustomPropertyQL</CustomPropertyQL>
    </typeMapping>
</configuration>

Am I doing anythins wrong here? I'm using version 1.8 of the plugin.

Thanks a lot!

Plugin delete existing files in <outputDir>

Hi,
In my project where is already one code generation plugin (apt-maven-plugin which generates code for QueryDSL framework at target/generated-sources/java)
When i added graphqlcodegen-maven-plugin i see that it successful generate code at target/generated-sources, but code for QueryDsl now is missing.
Both plugins execute at generate-sources maven phase, but from console output i see that graphqlcodegen-maven-plugin executes after apt-maven-plugin. So I purpose that it implicitly clear target/generated-sources folder before self code generation.

As workaround i change outputDir for graphqlcodegen-maven-plugin and was forced to add one more folder for source code at build-helper-maven-plugin

It will be nice if you change this behavior and plugin won't delete existing files in outputDir

Thank you.

GenerateClient not generating query builders

When <generateClient>true</generateClient> is added to the configuration it does not generate the client API classes.
Plugin definition:

                <groupId>io.github.deweyjose</groupId>
                <artifactId>graphqlcodegen-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <generateClient>true</generateClient>
                    <schemaPaths>
                        <param>src/main/resources/schema/schema.graphqls</param>
                    </schemaPaths>
                    <packageName>${project.base}/generated</packageName>
                </configuration>
            </plugin>

Plugin not generating query client classes

Hello, I was wondering if there is anything specific needed to generate the query java classes besides the following options:

<addGeneratedAnnotation>true</addGeneratedAnnotation>
<generateBoxedTypes>true</generateBoxedTypes>
<generateClient>true</generateClient>
<writeToFiles>true</writeToFiles>

I only see the following after the build is complete
image

Thanks.

Read typeMapping from a properties file available in compile-classpath

Use Case:
We have multiple subgraphs share common types. These common types together with the generated code(model) are packaged into a jar file. Subgraphs depend on this common-type jar to get all Common Type schema and code. But each subgraph has to manually add typeMapping, this is not optimal

  • Same typeMapping lines are repeated in multiple subgraphs
  • Higher chances of error
  • Subgraph developer has to check what is the generated class' package before adding it

Subgraph developer's experience would be better when

  • Common-types jar includes typeMapping.properties file within its classpath (say src/resources), which will have the mapping of all the GraphQL types and its Canonical class name.
  • Subgraph developer instead of (or in addition) typeMapping configuration, configures another parameter typeMappingPropertyFiles (which accepts an array of String)
  • Within the codegen plugin, when typeMappingPropertyFiles is present, properties files are loaded and values in it are appended to typeMapping Map.

Allow user to add custom directive to generated types

in type mapping allow users to add @sharable directive to PageInfo type
Use case i am using codegen to generate connection, node, edge,cursor, pageinfo type during runtime
My concern is when integrating with a federated supergraph, same types gives compose error as PageInfo is same across all subgraphs.
To tackle this we need to add @sharable on the connection related types and that should reflect on the SDL of the running graphql project
Is there any way to add @sharable tags for all connection types like connection,edge,cursor, node, pageinfo
also can we add totalCount as a property in Connection Type so that it looks like :

Connection{
  edges:[Edge!]
  pageInfo:PageInfo!
  totalCount:Int!
}

At the end PageInfo should look like in SDL:

type PageInfo @cacheControl(maxAge: 30) @shareable @tag(name: "public"){
    hasPreviousPage: Boolean!
    hasNextPage: Boolean!
    startCursor: String
    endCursor: String
}

Ultimately there should be a way to pass @cacheControl(maxAge: 30) @shareable @tag(name: "public") to PageInfo Type in codegen in typemapping or in any other way

What is the difference between graphql-dgs-codegen-core and graphql-dgs-codegen-client-core?

In the example project of this plugin the dependency

<dependency>
     <groupId>com.netflix.graphql.dgs.codegen</groupId>
     <artifactId>graphql-dgs-codegen-client-core</artifactId>
</dependency>

is used.
client-core is currently stuck at version 5.1.17 (from March last year).

On the dgs documentation https://netflix.github.io/dgs/generating-code-from-schema/ the dependency metioned is "codegen-core":

<dependency>
    <groupId>com.netflix.graphql.dgs.codegen</groupId>
    <artifactId>graphql-dgs-codegen-core</artifactId>
</dependency>

This one is also continuously getting new versions.
Is it possible to use a recent version of "codegen-core" with this plugin?

Generating of graphql client in Kotlin is generating classes with unresolved references

Hello,
I am having trouble with generating client from graphql schema in Kotlin. Generated classes have unresolved references such as com.netflix.graphql.dgs.codegen.GraphQLProjection and function field in getters. Also when i try to generate v2 client api it does not generate anything. I am using Kotlin 1.9.0 and plugin version 1.39. Here is my generated class:

package cz.cvut.fel.czm.temataprojectsclient.generated.client

import com.netflix.graphql.dgs.codegen.GraphQLProjection

public class DepartmentProjection : GraphQLProjection() {
  public val id: DepartmentProjection
    get() {
      field("id")
      return this
    }

  public val webCze: DepartmentProjection
    get() {
      field("webCze")
      return this
    }

  public val webEng: DepartmentProjection
    get() {
      field("webEng")
      return this
    }

  public val nameCze: DepartmentProjection
    get() {
      field("nameCze")
      return this
    }

  public val nameEng: DepartmentProjection
    get() {
      field("nameEng")
      return this
    }

  public val code: DepartmentProjection
    get() {
      field("code")
      return this
    }
}

And here is how i use plugin in pom.xml:

            <plugin>
                <groupId>io.github.deweyjose</groupId>
                <artifactId>graphqlcodegen-maven-plugin</artifactId>
                <version>${graphqlcodegen.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaPaths>
                        <param>${project.basedir}/../temata-projects-service-logic/src/main/resources/schema</param>
                    </schemaPaths>
                    <packageName>cz.cvut.fel.czm.temataprojectsclient.generated</packageName>
                    <generateClientApi>true</generateClientApi>
                    <outputDir>${project.basedir}/src/main/kotlin</outputDir>
                    <subPackageNameDatafetchers>fetchers</subPackageNameDatafetchers>
                    <subPackageNameTypes>types</subPackageNameTypes>
                    <language>kotlin</language>
                    <generateKotlinClosureProjections>true</generateKotlinClosureProjections>
                </configuration>
            </plugin>

Thank you for time.

Multiple executions with different config

I have two different graphql schemas that I want to generate clients for that share some type names.

If I put them both under one execution as schemaPaths then the types conflict and the generate code will not compile.

I tried to make 2 executions with different paths, which runs just fine, but the generate-sources ends up only containing the last run execution. generated-examples has an example for both executions.

        <plugins>
            <plugin>
                <groupId>io.github.deweyjose</groupId>
                <artifactId>graphqlcodegen-maven-plugin</artifactId>
                <version>1.11</version>
                <executions>
                    <execution>
                        <id>a</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <packageName>com.xxx.a.client</packageName>
                            <schemaPaths>
                                <param>src/main/resources/graphql/a/schema.graphql</param>
                            </schemaPaths>
                        </configuration>
                    </execution>
                    <execution>
                        <id>b</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <packageName>com.xxx.b.client</packageName>
                            <schemaPaths>
                                <param>src/main/resources/graphql/b/schema.graphql</param>
                            </schemaPaths>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <typeMapping>
                        <ObjectScalar>java.lang.Object</ObjectScalar>
                        <UUID>java.util.UUID</UUID>
                        <Map_String_ObjectScalar >java.util.Map</Map_String_ObjectScalar>
                        <Map_String_StringScalar>java.util.Map</Map_String_StringScalar>
                    </typeMapping>
                </configuration>
            </plugin>
        </plugins>

If this is as issue with the wrapped gradle generator i'll raise a ticket over there.


EDIT:

...
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< com.xxx.ui:xxx >---------------------
[INFO] Building xxx1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ xxx ---
[INFO] Deleting C:\Users\xxx\IdeaProjects\xxx\target
[INFO] 
[INFO] --- graphqlcodegen-maven-plugin:1.11:generate (a) @ xxx ---
[INFO] Codegen config:             --output-dir=C:\Users\xxx\IdeaProjects\xxx\target\generated-sources
            --package-name=com.xxx.a.client
            --sub-package-name-client=client
            --sub-package-name-datafetchers=datafetchers
            --sub-package-name-types=types
            
            --write-to-disk
            --language=JAVA
            
            --generate-data-types
            
            
            
            --type-mapping Map_String_ObjectScalar=java.util.Map
--type-mapping Map_String_StringScalar=java.util.Map
--type-mapping ObjectScalar=java.lang.Object
--type-mapping UUID=java.util.UUID           
            
            
[INFO] 
[INFO] --- graphqlcodegen-maven-plugin:1.11:generate (b) @ xxx---
[INFO] Codegen config:             --output-dir=C:\Users\xxx\IdeaProjects\xxx\target\generated-sources
            --package-name=com.xxx.b.client
            --sub-package-name-client=client
            --sub-package-name-datafetchers=datafetchers
            --sub-package-name-types=types
            
            --write-to-disk
            --language=JAVA
            
            --generate-data-types
            
            
            
            --type-mapping Map_String_ObjectScalar=java.util.Map
--type-mapping Map_String_StringScalar=java.util.Map
--type-mapping ObjectScalar=java.lang.Object
--type-mapping UUID=java.util.UUID           
            
            
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ xxx---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ xxx---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\xxx\IdeaProjects\xxx\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.142 s
[INFO] Finished at: 2021-08-01T17:53:45-04:00
[INFO] ------------------------------------------------------------------------

Classes in Client are not found when running Tests

java.lang.NoClassDefFoundError: <my class>
Caused by: java.lang.ClassNotFoundException: <>

This issue seems to be happening only when running tests on a class that uses "Client" generated classes. Compilation works fine so I suspect I'm missing some plugin config. Lmk, if there are any thoughts:

           <groupId>io.github.deweyjose</groupId>
            <artifactId>graphqlcodegen-maven-plugin</artifactId>
            <version>1.8</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <packageName><my package name></packageName>
                <schemaPaths>
                    <path>src/main/resources/schema.graphql</path>
                </schemaPaths>
                <language>kotlin</language>
                <outputDir>${project.build.directory}/generated</outputDir>
                <generateBoxedTypes>true</generateBoxedTypes>
                <generateClient>true</generateClient>
                <subPackageNameTypes>model</subPackageNameTypes>
                <subPackageNameClient>querybuilders</subPackageNameClient>
           </configuration>

schemaPaths multiple files

For larger GraphQL projects, it may happen that multiple schema files are required. In that case, for each and every GraphQL schema file, you'll have to add it to the pom. Is it possible to add support for adding paths? E.g.:

                    <schemaPaths>
                        <param>src/main/resources/schema/*.graphqls</param>
                    </schemaPaths>

Is there a way to distinguish explicit null values from missing values?

Thanks for the project. I have a question about how to distinguish explicit null values from missing values.

Let's use the schema in your example. Suppose I have a mutation that accepts a Show object, which has title as null and there's no releaseYear passed in. When the object gets mapped to a JAVA POJO, both title and releaseYear are null. Is there any way that my application could be aware of the difference?

integration with codegen and relay pagination

how can we write this under the plugin configuration for example:
gradle:
typeMapping = ["MessageConnection": "graphql.relay.SimpleListConnection<Message>"]

what will be the equivalent to maven?

<typeMapping>
	<MessageConnection>graphql.relay.SimpleListConnection<Message></MessageConnection>
</typeMapping>

What will be the FQN for graphql.relay.SimpleListConnection<Message> to configure codegen in maven
This above one gives error obviously, so how to do it ?

Exclude generated files from code coverage report

Hello!
Generated code is currently included in code coverage reports which may be undesirable. It would be great to annotate generated classes with some custom @Generated annotation. Jacoco excludes such annotated files automatically. This feature could be configurable to suit different needs.

Do not generate sources if schema was not changed

Currently, the plugin generates Java files, even if the schema was not changed, causing unnecessary compilations, when incremental compilation is used.
Can we get an option to allow incremental regeneration?

This could be something similar to skipGenerationIfSchemaHasNotChanged from graphql-maven-plugin:
https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/generateServerCode-mojo.html#skipgenerationifschemahasnotchanged

Plugin execution not covered by lifecycle configuration

I have a project that won't build in eclipse. I am getting the error

Plugin execution not covered by lifecycle configuration: io.github.deweyjose:graphqlcodegen-maven-plugin:1.8:generate (execution: default, phase: generate-sources)

I have the following the section configuration of the pom based on the readme

        <groupId>io.github.deweyjose</groupId>
        <artifactId>graphqlcodegen-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
            <execution>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <typeMapping>
                <PositiveDecimal>java.math.BigDecimal</PositiveDecimal>
                <PositiveInt>java.lang.Integer</PositiveInt>
            </typeMapping>
            <schemaPaths>
                <param>src/main/resources/schema/schema.graphqls</param>
            </schemaPaths>
            <packageName>org.example.graphql.generated</packageName>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                    <sources>
                        <source>${project.build.directory}/generated-sources</source>
                    </sources>
                </configuration>
            </execution>
        </executions>
    </plugin>

Additional Note: I also want to add the the original developer usee Intelj and doesn't seem to run into this issue. However even when I try to build on the maven command line I still get errors above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.