Skip to content

[generator] support input field deprecation #1361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

With recent GraphQL spec changes, deprecation should be supported on fields, input fields (new), arguments (new) and enum values. This change adds the support for deprecating input fields.

Argument deprecation is not supported as Kotlin @Deprecated is not applicable to parameters.

🔗 Related Issues

See https://youtrack.jetbrains.com/issue/KT-25643

With recent GraphQL spec changes, deprecation should be supported on fields, input fields (new), arguments (new) and enum values. This change adds the support for deprecating input fields.

Argument deprecation is not supported as Kotlin `@Deprecated` is not applicable to parameters. See https://youtrack.jetbrains.com/issue/KT-25643
@dariuszkuc dariuszkuc added type: enhancement New feature or request changes: patch Changes require a patch version module: generator Issue affects the schema generator and federation code labels Feb 13, 2022
@dariuszkuc dariuszkuc merged commit 1ee8541 into ExpediaGroup:master Feb 14, 2022
@dariuszkuc dariuszkuc deleted the input_field_deprecation branch February 14, 2022 17:51
dariuszkuc pushed a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
With recent GraphQL spec changes, deprecation should be supported on fields, input fields (new), arguments (new) and enum values. This change adds the support for deprecating input fields.

Argument deprecation is not supported as Kotlin `@Deprecated` is not applicable to parameters. See https://youtrack.jetbrains.com/issue/KT-25643
dariuszkuc pushed a commit that referenced this pull request Mar 12, 2025
…ed (#2075)

### 📝 Description  
This PR enables support for using the `@GraphQLDeprecated` annotation on
arguments, allowing the generated GraphQL schema to include the
`@deprecated` directive.

#### Changes:  
- Updated `generateArgument.kt ` to mark argument as deprecated if the
DeprecationReason is present.
- Added tests to validate the correct behavior when marking arguments as
deprecated.

#### Why?  
The GraphQL spec now officially supports applying `@deprecated` on
arguments, enabling better API evolution without breaking existing
clients. This change aligns the library with the latest spec, giving
developers a built-in way to signal argument deprecations.

- [GraphQL Spec - Deprecated
Arguments](https://spec.graphql.org/October2021/#sec--deprecated)
](https://spec.graphql.org/draft/#sec--deprecated)

### 🔗 Related Issues  
#1361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: patch Changes require a patch version module: generator Issue affects the schema generator and federation code type: enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants