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
I have to deal with a GraphQL API having a Type which has 377(!) fields.
When I generate the client classes out of the schema, the generated java class has two constructors: the default empty constructor and a constructor with all 377 fields as arguments.
This leads to a compilation error "too many parameters" since a constructor with that much parameters violates the java language specification.
Steps to Reproduce
Define a schema with a type having a lot of fields.
Generate and compile the client java classes
Expected Result
The compilation should work. In that case, a no-args constructor should be generated only.
Maybe we could have a config flag generateNoArgsConstrutctorOnly which defaults to false. If set to true, only the default no-args constructor will be generated, but not the one having all fields as parameter arguments.
The text was updated successfully, but these errors were encountered:
This is a good one.
I will add a new config as you suggested.
Just a little more info on this topic from JVM spec:
The number of method parameters is limited to 255 by the definition of a method descriptor (§4.3.3), where the limit includes one unit for this in the case of instance or interface method invocations. Note that a method descriptor is defined in terms of a notion of method parameter length in which a parameter of type long or double contributes two units to the length, so parameters of these types further reduce the limit.
Issue Description
I have to deal with a GraphQL API having a Type which has 377(!) fields.
When I generate the client classes out of the schema, the generated java class has two constructors: the default empty constructor and a constructor with all 377 fields as arguments.
This leads to a compilation error "too many parameters" since a constructor with that much parameters violates the java language specification.
Steps to Reproduce
Expected Result
generateNoArgsConstrutctorOnly
which defaults tofalse
. If set totrue
, only the default no-args constructor will be generated, but not the one having all fields as parameter arguments.The text was updated successfully, but these errors were encountered: