enum Fruit {
GRAPS @value(value: “GR”)
BANANAS @value(value : “BN”)
}
I have above Enum and expecting generated code like below using npx java codegen
public enum Fruit
{
GRAPS("GR");
BANANAS(“BN”);
private final String value;
Fruit(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public static Fruit fromValue(String value) {
for (Fruit fruit : Fruit.values()) {
if (fruit.value.equals(value)) {
return fruit;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
But the code generated without Enum value for the above Graphql schema so my question here is how to edit the schema file or do I need to add any configuration while generating the file using build gradle
public enum Fruit
{
GRAPS
BANANAS
private final String value;
Fruit(String value) {
this.value = value;
}
public String getValue() {
return value;
….}