# graphql-kotlin

Martin Brehovsky

04/13/2022, 2:01 AM
Hey guys, a quick suggestion / question - would it be possible to introduce
annotation which would also allow defining deprecated parts of the schema? In our system we use all warnings as errors compiler setting and deprecation requires us to suppress this warning all the time (this itself is another Kotlin issue). However if we would be able to use
in the same way as regular
it would allow us to separate the GraphQL schema deprecation from the actual code deprecation - they are in fact two different concerns. WDYT?

Shane Myrick

04/13/2022, 2:56 AM
Using the hooks you can watch any type or field being added for this Kotlin annotation and modify the type yourself to set the deprecation message. If we wanted to support other annotations it would be with some config that you could control how we get things like deprecated and the description, I don't think we need to add a duplicate annotation support

Martin Brehovsky

04/13/2022, 3:49 PM
I see - that's nice, I think this will work for us. Thanks for the pointers (and the flexibility in the library 🙂 )

Dariusz Kuc

04/13/2022, 3:52 PM
Personally I don't think it is a good idea to separate those out -> deprecations mean that folks shouldn't use it and migrate to use the replacement (if any). If you just mark it in the schema then there is nothing linking it to the code deprecation, so how do you know to clean up your code?