Skip to content
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

Add support for generated @deprecated arguments from @GraphQLDeprecated #2075

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

sanchezdale
Copy link
Contributor

@sanchezdale sanchezdale commented Mar 10, 2025

📝 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.

🔗 Related Issues

#1361

@sanchezdale sanchezdale marked this pull request as ready for review March 10, 2025 20:26
@sanchezdale sanchezdale marked this pull request as draft March 10, 2025 20:26
@sanchezdale sanchezdale marked this pull request as ready for review March 10, 2025 20:26
Copy link
Collaborator

@dariuszkuc dariuszkuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update docs under https://opensource.expediagroup.com/graphql-kotlin/docs/schema-generator/customizing-schemas/deprecating-schema to indicate that we can use @GraphQLDeprecated for deprecating arguments?

@sanchezdale
Copy link
Contributor Author

Can you also update docs under https://opensource.expediagroup.com/graphql-kotlin/docs/schema-generator/customizing-schemas/deprecating-schema to indicate that we can use @GraphQLDeprecated for deprecating arguments?

Updated the docs! let me know if that's a good format to show that

@sanchezdale sanchezdale requested a review from dariuszkuc March 11, 2025 14:16
@dariuszkuc
Copy link
Collaborator

@samuelAndalon can you take a look?

@dariuszkuc dariuszkuc added the changes: minor Changes require a minor version label Mar 12, 2025
@dariuszkuc dariuszkuc merged commit ce8124a into ExpediaGroup:master Mar 12, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: minor Changes require a minor version
Development

Successfully merging this pull request may close these issues.

None yet

3 participants