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
In our codebase I observed that the generated files are often recompiled without explicitly cleaning them or changing the schema. This isn't a big deal for small schemas but in our case it's over 400 files that are being recompiled and takes several seconds.
I don't have a repro-case yet but it should be fairly straight forward. I can imagine using one of the test/example projects and checking how often the files are being regenerated (it should only happen if the schema changed or after an explicit clean command).
sbt already has facilities to avoid unnecessary work (e.g. used to avoid compiling files that haven't changed), so we should use that here as well imo.
felixbr
changed the title
Only re-generate Scala files from GraphQL schema if schema changes
Only regenerate Scala files from GraphQL schema if schema changes
Sep 3, 2020
In our codebase I observed that the generated files are often recompiled without explicitly cleaning them or changing the schema. This isn't a big deal for small schemas but in our case it's over 400 files that are being recompiled and takes several seconds.
I don't have a repro-case yet but it should be fairly straight forward. I can imagine using one of the test/example projects and checking how often the files are being regenerated (it should only happen if the schema changed or after an explicit
clean
command).sbt
already has facilities to avoid unnecessary work (e.g. used to avoid compiling files that haven't changed), so we should use that here as well imo.References:
https://www.scala-sbt.org/1.x/docs/Caching.html
https://www.scala-sbt.org/1.x/docs/Cached-Resolution.html
The text was updated successfully, but these errors were encountered: