graphql-java-generator / graphql-maven-plugin-project

graphql-maven-plugin is a Maven Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com
MIT License
118 stars 47 forks source link

Reserved field "null" not correctly parsed with the graphql-maven-plugin #188

Closed hohler closed 1 year ago

hohler commented 1 year ago

Versions tested: 1.18, 2.0

A graphQL field named null is not correctly transformed. I've seen that it works correctly e.g. for fields named package

This is an example from the linear.app GraphQL schema.

generated class:

/**
 * Null constraint. Matches any non-null values if the given value is false, otherwise it matches null values.
 */
@JsonProperty("null")
@GraphQLScalar( fieldName = "null", graphQLTypeSimpleName = "Boolean", javaClass = java.lang.Boolean.class, listDepth = 0)
java.lang.Boolean null;

graphql Schema:

input NullableDateComparator {
  """
  Null constraint. Matches any non-null values if the given value is false, otherwise it matches null values.
  """
  null: Boolean
}
etienne-sf commented 1 year ago

Hello,

Yes, you're right.

The ´null´ keyword is missing in the keywords list :(

This will be solved in the next version.

Étienne

etienne-sf commented 1 year ago

Solved in the 2.0 release