Hello! The gradle plugin will add a deprecated ann...
# apollo-kotlin
t
Hello! The gradle plugin will add a deprecated annotation to classes when a deprecated mutation/query is used and generated code for. For example
w: file://.../operations/adapter/<name>_ResponseAdapter.kt:46:79 '@Deprecated(...) val ...' is deprecated. Deprecation reason here.
Is is possible to configure that these warnings should be treated as errors rather than warnings? 🤔 (Or some earlier error if deprecated mutations/queries are used)
b
👋 Kotlin has
allWarningsAsErrors
t
I would prefer to not make all warnings from other parts also errors, thinking maybe if it was possible to configure the level property of the annotation that is generated?
b
actually you can also use
failOnWarnings.set(true)
which will fail the codegen whenever a warning is encountered (that includes using deprecated fields in operations)
t
Oh, interesting! That will do. Thanks 😊
🎉 2
s
Is that failOnWarnings an Apollo configuration or an overall config somewhere? Trying to understand how it's different than allWarningsAsErrors
b
yes it's declared on a service, so it's specific to the Apollo codegen
s
tenor_gif2159385968959988485.gif
😂 1