Skip to content

Commit b9ae564

Browse files
committed
WIP, minor updates to deprecated directive description
1 parent f9bd6c2 commit b9ae564

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

docs/advanced/directives.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,14 @@ The `@deprecated` directive is a built in type system directive provided by grap
239239
```csharp
240240
public sealed class DeprecatedDirective : GraphDirective
241241
{
242-
[DirectiveLocations(DirectiveLocation.FIELD_DEFINITION | DirectiveLocation.ENUM_VALUE)]
243-
public IGraphActionResult Execute([FromGraphQL("reason")] string reason = "No longer supported")
244-
{
245-
if (this.DirectiveTarget is IGraphField field)
246-
{
247-
field.IsDeprecated = true;
248-
field.DeprecationReason = reason;
249-
}
250-
else if (this.DirectiveTarget is IEnumValue enumValue)
242+
// additional validation checks and locations are excluded for brevity
243+
[DirectiveLocations(DirectiveLocation.FIELD_DEFINITION)]
244+
public IGraphActionResult Execute([FromGraphQL("reason", TypeExpression = "Type!")] string reason)
245+
{
246+
if (this.DirectiveTarget is IDeprecatable deprecatable)
251247
{
252-
enumValue.IsDeprecated = true;
253-
enumValue.DeprecationReason = reason;
248+
deprecatable.IsDeprecated = true;
249+
deprecatable.DeprecationReason = reason;
254250
}
255251

256252
return this.Ok();
@@ -260,9 +256,14 @@ public sealed class DeprecatedDirective : GraphDirective
260256

261257
This Directive:
262258

263-
- Targets a FIELD_DEFINITION or ENUM_VALUE.
264-
- Marks the field or enum value as deprecated and attaches the provided deprecation reason
265-
- The directive is executed once per field definition and enum value its applied to when the schema is created.
259+
- Marks a field, input field, enum value or argument as deprecated and attaches the provided deprecation reason
260+
- Requires that a reason for deprecation be supplied
261+
- The directive is executed once per definition its applied to when the schema is created.
262+
263+
264+
:::info
265+
Deprecation reason became a required value with the Sept. '25 specification update. (Library version v1.5)
266+
:::
266267

267268
### Custom Example: @toLower
268269

docs/quick/overview.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ Use the menus on the left to navigate through the documentation. You do not need
1010

1111
## Nuget & Installation
1212

13-
<span className="pill">.NET Standard 2.0</span> <span className="pill">.NET 8</span> <span className="pill">.NET 9</span> <br/><br/>
13+
<span className="pill">.NET 8+</span><br/><br/>
14+
1415

1516
The library is available on [nuget](https://www.nuget.org/packages/GraphQL.AspNet/) and can be added to your project via the conventional means.
1617

18+
1719
```powershell title="How to Install The Library"
1820
# Using the dotnet CLI
1921
> dotnet add package GraphQL.AspNet
@@ -30,6 +32,8 @@ The library is available on [nuget](https://www.nuget.org/packages/GraphQL.AspNe
3032
</span>
3133

3234

35+
36+
3337
## Other Helpful Pages
3438

3539
These pages may be helpful in getting started with the library:

0 commit comments

Comments
 (0)