-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error generating classes from generateClientApi or generateClientApiV2 #692
Comments
Hi @annarafaeladev. What version of the dgs-codegen are you using? For your issue, in the latest version of the dgs-codegen gradle plugin v6.2.1, I am not able to replicate the errors with the schema provided. It may be related to the maven port, have you tried that community? That would be this github page |
Maven Home version: 3.9.6 <dependencyManagement>
<dependencies>
<dependency>
<groupId>com.netflix.graphql.dgs</groupId>
<artifactId>graphql-dgs-platform-dependencies</artifactId>
<!-- The DGS BOM/platform dependency. This is the only place you set version of DGS -->
<version>3.10.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement> graphqlcodegen-maven-plugin version: 1.50 <plugins>
<plugin>
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.50</version>
<executions>
<execution>
<id>dgs-codegen</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaPaths>
<param>src/main/resources/graphql-client/schema.graphqls</param>
</schemaPaths>
<packageName>com.graphql.engine.codegen</packageName>
<addGeneratedAnnotation>true</addGeneratedAnnotation>
<generateClientApi>true</generateClientApi>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-dgs-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins> |
I noticed that the version you are using for the dgs BOM is bit outdated at v3.10.2. Right now latest is v8.6.1. Can you try upgrading to the latest version? I'm not sure if that will solve your issue but it might be a good start. |
its ok, so i updated dependencies for version 8.6.1 but the problem persist. I copied the pom.xml with dependencies correctly updated. Versão Maven Home: 3.9.6 <dependency>
<groupId>com.netflix.graphql.dgs</groupId>
<artifactId>graphql-dgs-spring-boot-starter</artifactId>
<version>8.6.1</version>
</dependency>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.netflix.graphql.dgs</groupId>
<artifactId>graphql-dgs-platform-dependencies</artifactId>
<!-- The DGS BOM/platform dependency. This is the only place you set version of DGS -->
<version>8.6.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement> ERROR after update dependency version 8.6.1
error ocurrently in line 3 |
Per the docs here: https://netflix.github.io/dgs/generating-code-from-schema/#client-api-v2 You are missing an additional
|
Sorry, I don't understand where I should add this code snippet since the classes Could you explain me? And after modifying the plugin version, the codegen client import is giving a not found error |
Ok, after lookingcloser, the error is in the generated classes. My guess is that somehow you are missing the |
I added the mentioned dependency but the problem persists: <dependency>
<groupId>com.netflix.graphql.dgs.codegen</groupId>
<artifactId>graphql-dgs-codegen-shared-core</artifactId>
<version>6.2.1</version>
<scope>runtime</scope>
</dependency> My project is a project created in spring initializer java 17 maven with spring version 3.2.5 this is pom.xml updated: pom.xml Detailsmaven
|
Hi @annarafaeladev - we don't support the maven port of codegen here. Please try https://github.com/deweyjose/graphqlcodegen for help with this issue. |
Error generating classes from generateClientApi or generateClientApiV2.
Constructors with invalid number of arguments.
schemas:
I'm using graphqlcodegen-maven-plugin to generate the code. When I run
mvn clean install
the command generates the classes but with an error:file: ShowsProjectionRoot.java
this is error:
constructor BaseSubProjectionNode in class com.netflix.graphql.dgs.client.codegen.BaseSubProjectionNode<T,R> cannot be applied to given types;
other file ShowsGraphQLQuery with error:
ERROR:
no suitable constructor found for GraphQLQuery(java.lang.String,java.lang.String)
The text was updated successfully, but these errors were encountered: