You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a field of type Int!, Boolean!, Float! are declared the codegen use the corresponding primitive type.
While using generated client model if a mandatory integer field is not set the generated mutation will send 0 whereas a validation error should have bean thrown.
Steps to Reproduce
send a mutation query for a input having field with the above mentioned types without filling the values.
Expected Result
Fails with Validation error server side.
Actual Result
Primitive types have a default value. The generated query will have those values when none where provided
Your Environment and Setup
graphql-java-codegen version: 5.5.0
Build tool: Gradle
============
Primitive types should be removed. The issue might also happen to queries with parameters.
The text was updated successfully, but these errors were encountered:
This will become a breaking change if we modify how GraphQL request is serialized.
Some existing users of the plugin might already expect that the plugin will send default primitive values if they don't supply it in the input, for example:
This configuration will generate your model classes with Integer/Double/Boolean fields + @NotNull annotations. Which you can use then to validate your objects prior sending to a GraphQL server. And also the resulting query will be generated without default primitive values (0 for int, false for boolean, etc) if they are not supplied in the input
Hope that helps!
Issue Description
When a field of type Int!, Boolean!, Float! are declared the codegen use the corresponding primitive type.
While using generated client model if a mandatory integer field is not set the generated mutation will send 0 whereas a validation error should have bean thrown.
Steps to Reproduce
send a mutation query for a
input
havingfield
with the above mentioned types without filling the values.Expected Result
Fails with Validation error server side.
Actual Result
Primitive types have a default value. The generated query will have those values when none where provided
Your Environment and Setup
============
Primitive types should be removed. The issue might also happen to queries with parameters.
The text was updated successfully, but these errors were encountered: