apollo-kotlin icon indicating copy to clipboard operation
apollo-kotlin copied to clipboard

Adding a @typePolicy slows down code generation

Open GokhanArik opened this issue 8 months ago • 2 comments

Version

4.1.1

Summary

Hi team,

After adding @typePolicy by extending the schema generateApolloIrOperations started taking very long to complete. As an example, the latest build took 3h15m and 2,5h was spent on this task.

Example:

extend type Some Tyoe @typePolicy(keyFields: "a b")

There is a comment on this line, I wonder if it is caused by this: https://github.com/apollographql/apollo-kotlin/blob/a3c11be76a79551394ee25de653bff01c60720bd/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/ApolloCompiler.kt#L292-L294

Steps to reproduce the behavior

No response

Logs

(Your logs here)

GokhanArik avatar Apr 07 '25 01:04 GokhanArik

More than 2h is indeed a very long time. Would it possible to share your schema and operations (can be done privately at [email protected])? That would help us reproduce and investigate the issue. Thanks!

BoD avatar Apr 07 '25 07:04 BoD

Update: we received the schema/operations, thank you for that - and looking into it.

See also #6444.

BoD avatar Apr 25 '25 10:04 BoD

Probably a dupe of https://github.com/apollographql/apollo-kotlin/issues/6444? Let's double check if the issue is still there with the new cache.

martinbonnin avatar Jun 27 '25 10:06 martinbonnin

Closing in favor of #6444. Please don't hesitate to comment if you still see this happening with the new cache.

BoD avatar Jul 24 '25 14:07 BoD

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.

github-actions[bot] avatar Jul 24 '25 14:07 github-actions[bot]