Generate Deprecated Annotation For Queries
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I am having a hard time developing my graphql schema with deprecated queries, mutations and subscriptions.
I have found the config property "addDeprecatedAnnotation", which transforms input values into correctly annotated deprecated methods. (See graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/ClientApiGenerator.kt)
I need the same to work for queries, mutations and subscriptions on class level, e.g.:
schema.graphql:
"Query root"
type Query {
doSomething(anInput: String): Void @deprecated(reason : "Use doSomethingElse instead.")}
should translate into:
/**
- @deprecated Use doSomethingElse instead.
*/
@Deprecated
public class DoSomethingGraphQLQuery extends GraphQLQuery {...}
I would be grateful for any help here. Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/ClientApiGenerator.kt, where addDeprecatedAnnotation already handles input values. Trace how query, mutation, and subscription classes are generated, then verify that schema-level @deprecated reasons produce class-level JavaDoc and @Deprecated annotations for those generated classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, kotlin
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100