---
# Don't modify this file manually. This file is auto generated from source, and you will lose your changes next time the website is built.
# Head to the `biomejs/biome` repository, and modify the source code in there.

title: useDeprecatedReason
description: Learn more about useDeprecatedReason
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="GraphQL" icon="seti:graphql">
## Summary
- Rule available since: `v1.9.0`
- Diagnostic Category: [`lint/style/useDeprecatedReason`](/reference/diagnostics#diagnostic-category)
- This rule is **recommended**, meaning it is enabled by default.
- This rule doesn't have a fix.
- The default severity of this rule is [**warning**](/reference/diagnostics#warning).
- Sources: 
  - Same as [`@graphql-eslint/require-deprecation-reason`](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason)

## How to configure
```json title="biome.json"
{
	"linter": {
		"rules": {
			"style": {
				"useDeprecatedReason": "error"
			}
		}
	}
}

```
## Description
Require specifying the reason argument when using `@deprecated` directive

This rule checks the parameter of `@deprecated` directive for the use of reason argument,
suggesting user to add it in case the argument is missing.

## Examples

### Invalid

```graphql
query {
  member @deprecated
}
```

<pre class="language-text"><code class="language-text">code-block.graphql:2:10 <a href="https://biomejs.dev/linter/rules/use-deprecated-reason">lint/style/useDeprecatedReason</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">The directive &#96;@deprecated&#96; should have a &#96;reason&#96; argument.</span><br />  <br />    <strong>1 │ </strong>query &#123;<br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>2 │ </strong>  member @deprecated<br />   <strong>   │ </strong>         <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>3 │ </strong>&#125;<br />    <strong>4 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Add a &#96;reason&#96; argument to the directive.</span><br />  <br /></code></pre>

### Valid

```graphql
query {
  member @deprecated(reason: "Why?")
}
```

## Related links

- [Disable a rule](/linter/#disable-a-rule)
- [Configure the code fix](/linter#configure-the-code-fix)
- [Rule options](/linter/#rule-options)
- [Source Code](https://github.com/biomejs/biome/blob/main/crates/biome_graphql_analyze/src/lint/style/use_deprecated_reason.rs)
- [Test Cases](https://github.com/biomejs/biome/blob/main/crates/biome_graphql_analyze/tests/specs/style/useDeprecatedReason)

</TabItem>
</Tabs>