diff --git a/CHANGELOG.md b/CHANGELOG.md index 685e6d0d1..103ab58a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co ## Unreleased +## v6.44.0 + +### Added + +- Allow `@deprecated` directive on arguments and input fields https://github.com/nuwave/lighthouse/pull/2607 + ## v6.43.1 ### Changed diff --git a/docs/6/api-reference/directives.md b/docs/6/api-reference/directives.md index 50db50e59..d53a98e6f 100644 --- a/docs/6/api-reference/directives.md +++ b/docs/6/api-reference/directives.md @@ -1165,17 +1165,16 @@ Marks an element of a GraphQL schema as no longer supported. """ directive @deprecated( """ - Explains why this element was deprecated, usually also including a - suggestion for how to access supported similar data. - Formatted in [Markdown](https://commonmark.org). + Explains why this element was deprecated. + It is also beneficial to suggest what to use instead. + Formatted in Markdown, as specified by [CommonMark](https://commonmark.org). """ reason: String = "No longer supported" -) on FIELD_DEFINITION | ENUM_VALUE +) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE ``` -You can mark fields as deprecated by adding the [@deprecated](#deprecated) directive. -It is recommended to provide a `reason` for the deprecation, as well as a suggestion on -how to move forward. +You can indicate schema elements are no longer supported by adding the [@deprecated](#deprecated) directive. +It is recommended to provide a `reason` for the deprecation, as well as suggest a replacement. ```graphql type Query { diff --git a/docs/master/api-reference/directives.md b/docs/master/api-reference/directives.md index 50db50e59..d53a98e6f 100644 --- a/docs/master/api-reference/directives.md +++ b/docs/master/api-reference/directives.md @@ -1165,17 +1165,16 @@ Marks an element of a GraphQL schema as no longer supported. """ directive @deprecated( """ - Explains why this element was deprecated, usually also including a - suggestion for how to access supported similar data. - Formatted in [Markdown](https://commonmark.org). + Explains why this element was deprecated. + It is also beneficial to suggest what to use instead. + Formatted in Markdown, as specified by [CommonMark](https://commonmark.org). """ reason: String = "No longer supported" -) on FIELD_DEFINITION | ENUM_VALUE +) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE ``` -You can mark fields as deprecated by adding the [@deprecated](#deprecated) directive. -It is recommended to provide a `reason` for the deprecation, as well as a suggestion on -how to move forward. +You can indicate schema elements are no longer supported by adding the [@deprecated](#deprecated) directive. +It is recommended to provide a `reason` for the deprecation, as well as suggest a replacement. ```graphql type Query { diff --git a/src/Schema/Directives/DeprecatedDirective.php b/src/Schema/Directives/DeprecatedDirective.php index 8607233ca..76e2fef2d 100644 --- a/src/Schema/Directives/DeprecatedDirective.php +++ b/src/Schema/Directives/DeprecatedDirective.php @@ -14,12 +14,12 @@ public static function definition(): string """ directive @deprecated( """ - Explains why this element was deprecated, usually also including a - suggestion for how to access supported similar data. Formatted - in [Markdown](https://daringfireball.net/projects/markdown). + Explains why this element was deprecated. + It is also beneficial to suggest what to use instead. + Formatted in Markdown, as specified by [CommonMark](https://commonmark.org). """ reason: String = "No longer supported" -) on FIELD_DEFINITION | ENUM_VALUE +) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE GRAPHQL; } }