Skip to content

Commit 4b2f018

Browse files
committed
Update deprecated directive description
1 parent 6e4f1f2 commit 4b2f018

10 files changed

Lines changed: 24 additions & 22 deletions

src/main/java/graphql/Directives.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class Directives {
7575
.directiveLocation(newDirectiveLocation().name(ARGUMENT_DEFINITION.name()).build())
7676
.directiveLocation(newDirectiveLocation().name(INPUT_FIELD_DEFINITION.name()).build())
7777
.directiveLocation(newDirectiveLocation().name(DIRECTIVE_DEFINITION.name()).build())
78-
.description(createDescription("Marks the field, argument, input field or enum value as deprecated"))
78+
.description(createDescription("Marks an element of a GraphQL schema as no longer supported."))
7979
.inputValueDefinition(
8080
newInputValueDefinition()
8181
.name("reason")
@@ -218,7 +218,7 @@ public class Directives {
218218
*/
219219
public static final GraphQLDirective DeprecatedDirective = GraphQLDirective.newDirective()
220220
.name(DEPRECATED)
221-
.description("Marks the field, argument, input field or enum value as deprecated")
221+
.description("Marks an element of a GraphQL schema as no longer supported.")
222222
.argument(newArgument()
223223
.name("reason")
224224
.type(nonNull(GraphQLString))

src/test/groovy/graphql/Issue2141.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ directive @defer(
3232
label: String
3333
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
3434
35-
"Marks the field, argument, input field or enum value as deprecated"
35+
"Marks an element of a GraphQL schema as no longer supported."
3636
directive @deprecated(
3737
"The reason for the deprecation"
3838
reason: String! = "No longer supported"

src/test/groovy/graphql/introspection/DirectiveDeprecationIntrospectionTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class DirectiveDeprecationIntrospectionTest extends Specification {
2626
}
2727
allDirectives: directives(includeDeprecated: true) {
2828
name
29+
description
2930
isDeprecated
3031
deprecationReason
3132
locations
@@ -44,6 +45,7 @@ class DirectiveDeprecationIntrospectionTest extends Specification {
4445
old.isDeprecated
4546
old.deprecationReason == "Use @active"
4647
def deprecated = result.data.__schema.allDirectives.find { it.name == "deprecated" }
48+
deprecated.description == "Marks an element of a GraphQL schema as no longer supported."
4749
deprecated.locations.contains("DIRECTIVE_DEFINITION")
4850
}
4951

src/test/groovy/graphql/schema/idl/SchemaPrinterTest.groovy

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ directive @defer(
974974
label: String
975975
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
976976
977-
"Marks the field, argument, input field or enum value as deprecated"
977+
"Marks an element of a GraphQL schema as no longer supported."
978978
directive @deprecated(
979979
"The reason for the deprecation"
980980
reason: String! = "No longer supported"
@@ -1161,7 +1161,7 @@ directive @defer(
11611161
label: String
11621162
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
11631163
1164-
"Marks the field, argument, input field or enum value as deprecated"
1164+
"Marks an element of a GraphQL schema as no longer supported."
11651165
directive @deprecated(
11661166
"The reason for the deprecation"
11671167
reason: String! = "No longer supported"
@@ -1268,7 +1268,7 @@ directive @defer(
12681268
label: String
12691269
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
12701270
1271-
"Marks the field, argument, input field or enum value as deprecated"
1271+
"Marks an element of a GraphQL schema as no longer supported."
12721272
directive @deprecated(
12731273
"The reason for the deprecation"
12741274
reason: String! = "No longer supported"
@@ -1347,7 +1347,7 @@ directive @defer(
13471347
label: String
13481348
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
13491349
1350-
"Marks the field, argument, input field or enum value as deprecated"
1350+
"Marks an element of a GraphQL schema as no longer supported."
13511351
directive @deprecated(
13521352
"The reason for the deprecation"
13531353
reason: String! = "No longer supported"
@@ -1455,7 +1455,7 @@ directive @defer(
14551455
label: String
14561456
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
14571457
1458-
"Marks the field, argument, input field or enum value as deprecated"
1458+
"Marks an element of a GraphQL schema as no longer supported."
14591459
directive @deprecated(
14601460
"The reason for the deprecation"
14611461
reason: String! = "No longer supported"
@@ -1552,7 +1552,7 @@ directive @defer(
15521552
label: String
15531553
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
15541554
1555-
"Marks the field, argument, input field or enum value as deprecated"
1555+
"Marks an element of a GraphQL schema as no longer supported."
15561556
directive @deprecated(
15571557
"The reason for the deprecation"
15581558
reason: String! = "No longer supported"
@@ -1703,7 +1703,7 @@ directive @defer(
17031703
label: String
17041704
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
17051705
1706-
"Marks the field, argument, input field or enum value as deprecated"
1706+
"Marks an element of a GraphQL schema as no longer supported."
17071707
directive @deprecated(
17081708
"The reason for the deprecation"
17091709
reason: String! = "No longer supported"
@@ -1948,7 +1948,7 @@ type Query {
19481948
def result = new SchemaPrinter(printOptions).print(schema)
19491949

19501950
then:
1951-
result == '''"Marks the field, argument, input field or enum value as deprecated"
1951+
result == '''"Marks an element of a GraphQL schema as no longer supported."
19521952
directive @deprecated(
19531953
"The reason for the deprecation"
19541954
reason: String! = "No longer supported"
@@ -2250,7 +2250,7 @@ directive @defer(
22502250
label: String
22512251
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
22522252
2253-
"Marks the field, argument, input field or enum value as deprecated"
2253+
"Marks an element of a GraphQL schema as no longer supported."
22542254
directive @deprecated(
22552255
"The reason for the deprecation"
22562256
reason: String! = "No longer supported"
@@ -2488,7 +2488,7 @@ directive @include(
24882488
"This directive disables error propagation when a non nullable field returns null for the given operation."
24892489
directive @experimental_disableErrorPropagation on QUERY | MUTATION | SUBSCRIPTION
24902490
2491-
"Marks the field, argument, input field or enum value as deprecated"
2491+
"Marks an element of a GraphQL schema as no longer supported."
24922492
directive @deprecated(
24932493
"The reason for the deprecation"
24942494
reason: String! = "No longer supported"
@@ -2620,7 +2620,7 @@ directive @defer(
26202620
label: String
26212621
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
26222622
2623-
"Marks the field, argument, input field or enum value as deprecated"
2623+
"Marks an element of a GraphQL schema as no longer supported."
26242624
directive @deprecated(
26252625
"The reason for the deprecation"
26262626
reason: String! = "No longer supported"
@@ -2868,7 +2868,7 @@ directive @defer(
28682868
label: String
28692869
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
28702870
2871-
"Marks the field, argument, input field or enum value as deprecated"
2871+
"Marks an element of a GraphQL schema as no longer supported."
28722872
directive @deprecated(
28732873
"The reason for the deprecation"
28742874
reason: String! = "No longer supported"
@@ -3067,7 +3067,7 @@ directive @defer(
30673067
label: String
30683068
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
30693069
3070-
"Marks the field, argument, input field or enum value as deprecated"
3070+
"Marks an element of a GraphQL schema as no longer supported."
30713071
directive @deprecated(
30723072
"The reason for the deprecation"
30733073
reason: String! = "No longer supported"

src/test/groovy/graphql/util/AnonymizerTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ type Object1 {
749749
750750
directive @Directive1(argument1: String! = "stringValue4") repeatable on SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
751751
752-
"Marks the field, argument, input field or enum value as deprecated"
752+
"Marks an element of a GraphQL schema as no longer supported."
753753
directive @deprecated(
754754
"The reason for the deprecation"
755755
reason: String! = "No longer supported"

src/test/resources/large-schema-1.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ directive @skip(
1515
if: Boolean!
1616
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
1717

18-
"Marks the field, argument, input field or enum value as deprecated"
18+
"Marks an element of a GraphQL schema as no longer supported."
1919
directive @deprecated(
2020
"The reason for the deprecation"
2121
reason: String! = "No longer supported"

src/test/resources/large-schema-5.graphqls.part1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ directive @defer(
172172
label: String
173173
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
174174

175-
"Marks the field, argument, input field or enum value as deprecated"
175+
"Marks an element of a GraphQL schema as no longer supported."
176176
directive @deprecated(
177177
"The reason for the deprecation"
178178
reason: String! = "No longer supported"

src/test/resources/large-schema-federated-1.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ directive @defer(
66
label: String
77
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
88

9-
"Marks the field, argument, input field or enum value as deprecated"
9+
"Marks an element of a GraphQL schema as no longer supported."
1010
directive @deprecated(
1111
"The reason for the deprecation"
1212
reason: String! = "No longer supported"

src/test/resources/large-schema-federated-2.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ directive @defer(
66
label: String
77
) on FRAGMENT_SPREAD | INLINE_FRAGMENT
88

9-
"Marks the field, argument, input field or enum value as deprecated"
9+
"Marks an element of a GraphQL schema as no longer supported."
1010
directive @deprecated(
1111
"The reason for the deprecation"
1212
reason: String! = "No longer supported"

src/test/resources/many-fragments.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ directive @Directive8(argument7: Enum3!) on FIELD_DEFINITION
2525

2626
directive @Directive9(argument8: String!) on OBJECT
2727

28-
"Marks the field, argument, input field or enum value as deprecated"
28+
"Marks an element of a GraphQL schema as no longer supported."
2929
directive @deprecated(
3030
"The reason for the deprecation"
3131
reason: String! = "No longer supported"

0 commit comments

Comments
 (0)