Skip to content

Commit 34730e8

Browse files
authored
Make the reason argument in @deprecated non-nullable (#1040)
* Make the reason argument in `@deprecated` non-nullable * update language for deprecationReason * add missing bang
1 parent df1acea commit 34730e8

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

spec/Section 3 -- Type System.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ condition is false.
21012101

21022102
```graphql
21032103
directive @deprecated(
2104-
reason: String = "No longer supported"
2104+
reason: String! = "No longer supported"
21052105
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
21062106
```
21072107

spec/Section 4 -- Introspection.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CommonMark-compliant Markdown renderer.
110110

111111
To support the management of backwards compatibility, GraphQL fields, arguments,
112112
input fields, and enum values can indicate whether or not they are deprecated
113-
(`isDeprecated: Boolean`) along with a description of why it is deprecated
113+
(`isDeprecated: Boolean!`) along with a description of why it is deprecated
114114
(`deprecationReason: String`).
115115

116116
Tools built using GraphQL introspection should respect deprecation by
@@ -424,7 +424,8 @@ Fields\:
424424
this field.
425425
- `isDeprecated` returns {true} if this field should no longer be used,
426426
otherwise {false}.
427-
- `deprecationReason` optionally provides a reason why this field is deprecated.
427+
- `deprecationReason` returns the reason why this field is deprecated, or null
428+
if this field is not deprecated.
428429

429430
### The \_\_InputValue Type
430431

@@ -442,8 +443,8 @@ Fields\:
442443
provided at runtime. If this input value has no default value, returns {null}.
443444
- `isDeprecated` returns {true} if this input field or argument should no longer
444445
be used, otherwise {false}.
445-
- `deprecationReason` optionally provides a reason why this input field or
446-
argument is deprecated.
446+
- `deprecationReason` returns the reason why this input field or argument is
447+
deprecated, or null if the input field or argument is not deprecated.
447448

448449
### The \_\_EnumValue Type
449450

@@ -455,8 +456,8 @@ Fields\:
455456
- `description` may return a String or {null}.
456457
- `isDeprecated` returns {true} if this enum value should no longer be used,
457458
otherwise {false}.
458-
- `deprecationReason` optionally provides a reason why this enum value is
459-
deprecated.
459+
- `deprecationReason` returns the reason why this enum value is deprecated, or
460+
null if the enum value is not deprecated.
460461

461462
### The \_\_Directive Type
462463

0 commit comments

Comments
 (0)