Skip to content

Commit

Permalink
Make the reason argument in @deprecated non-nullable (#1040)
Browse files Browse the repository at this point in the history
* Make the reason argument in `@deprecated` non-nullable

* update language for deprecationReason

* add missing bang
  • Loading branch information
martinbonnin authored Dec 5, 2024
1 parent df1acea commit 34730e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ condition is false.

```graphql
directive @deprecated(
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
```

Expand Down
13 changes: 7 additions & 6 deletions spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ CommonMark-compliant Markdown renderer.

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

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

### The \_\_InputValue Type

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

### The \_\_EnumValue Type

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

### The \_\_Directive Type

Expand Down

0 comments on commit 34730e8

Please sign in to comment.