Issue Description
The Gradle plugin graphql-java-codegen produces invalid Java source code for GraphQL types which implement an interface if the option generateParameterizedFieldsResolvers is disabled.
This bug might have been introduced by #913 .
Steps to Reproduce
GraphQL:
interface A {
foo(arg: String): String
}
type B implements A {
foo(arg: String): String
}
Expected Result
The Java interface A and class B should have a method String getFoo() without parameters.
A.java
public interface A {
String getFoo();
}
B.java
public class B implements java.io.Serializable, A {
private static final long serialVersionUID = 1L;
private String foo;
public B() {
}
public B(String foo) {
this.foo = foo;
}
public String getFoo() {
return foo;
}
public void setFoo(String foo) {
this.foo = foo;
}
[...]
}
Actual Result
The Java interface A has a method String getFoo(String arg) with a parameter while the Java class B has a method public String getFoo() * without* parameters.
This prevents class B to be compiled, because the contract of interface A is not fulfilled.
A.java
public interface A {
String getFoo(String arg);
}
B.java
public class B implements java.io.Serializable, A {
private static final long serialVersionUID = 1L;
private String foo;
public B() {
}
public B(String foo) {
this.foo = foo;
}
public String getFoo() {
return foo;
}
public void setFoo(String foo) {
this.foo = foo;
}
[...]
}
Your Environment and Setup
- graphql-java-codegen version: 5.4.0
- Build tool: Gradle
- Mapping Config:
generateApis = false
generateClient = true
generateParameterizedFieldsResolvers = false
Issue Description
The Gradle plugin graphql-java-codegen produces invalid Java source code for GraphQL types which implement an interface if the option
generateParameterizedFieldsResolversis disabled.This bug might have been introduced by #913 .
Steps to Reproduce
GraphQL:
Expected Result
The Java interface
Aand classBshould have a methodString getFoo()without parameters.A.java
B.java
Actual Result
The Java interface
Ahas a methodString getFoo(String arg)with a parameter while the Java classBhas a methodpublic String getFoo()* without* parameters.This prevents class
Bto be compiled, because the contract of interfaceAis not fulfilled.A.java
B.java
Your Environment and Setup