apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.77k stars 656 forks source link

"Method too large" error during compilation of schema module #6229

Open GokhanArik opened 3 weeks ago

GokhanArik commented 3 weeks ago

Version

4.0.2-2024.10.25

Summary

Hi team,

I'm getting this error when I run the codegen. We have over 10K types.

Error generating class file .../schema/__Schema.class (compiled from .../schema/__Schema.kt]): Method too large: .../schema/__Schema.<clinit> ()V

Steps to reproduce the behavior

No response

Logs

(Your logs here)
martinbonnin commented 3 weeks ago

Thanks for raising this 🙏 . Just for clarifying, this is not a regression, right? I don't think we changed that part of codegen recently.

Also, but I'm guessing you know that already, you can disable __Schema generation with generateSchema.set(false) and generateDataBuilders.set(false) (Data builders use those types)

GokhanArik commented 3 weeks ago

I didn't know to be honest, thanks! We wanted to try Data Builders and enabled generateDataBuilders which enables generateSchema. I guess we cannot try it until there is a fix for this.