Skip to content

Compilation of generated classes fails if GraphQL Types have a lot of fields #1017

@andreloeffelmann

Description

@andreloeffelmann

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

  • 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood-first-issueGood for newcomers

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions