Skip to content

Commit

Permalink
Ensure deprecationReason is set for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke authored Sep 2, 2024
1 parent e3ba8f0 commit e6210f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

### Fixed
- Ensure `deprecationReason` is set on arguments and input fields https://github.com/nuwave/lighthouse/pull/2609

## v6.44.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/AST/ASTHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public static function qualifiedArgType(
}

/** Given a collection of directives, returns the string value for the deprecation reason. */
public static function deprecationReason(EnumValueDefinitionNode|FieldDefinitionNode $node): ?string
public static function deprecationReason(EnumValueDefinitionNode|FieldDefinitionNode|InputValueDefinitionNode $node): ?string
{
$deprecated = Values::getDirectiveValues(
DirectiveDefinition::deprecatedDirective(),
Expand Down
1 change: 1 addition & 0 deletions src/Schema/Factories/ArgumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function convert(InputValueDefinitionNode $definitionNode): array
'name' => $definitionNode->name->value,
'description' => $definitionNode->description?->value,
'type' => $type,
'deprecationReason' => ASTHelper::deprecationReason($definitionNode),
'astNode' => $definitionNode,
];

Expand Down

0 comments on commit e6210f7

Please sign in to comment.