# no-deprecated-required-argument

Source: https://apigenie.pl/docs/linter/graphql/rules/no-deprecated-required-argument

This rule checks that required arguments and input fields are not deprecated.

## Rule Details

Clients cannot stop sending a required argument (non-null and without a default value), so deprecating it has no effect; the specification forbids it. Make the argument optional, or give it a default value, before deprecating it.

## Configuration

This rule has no options.

```yaml
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        no-deprecated-required-argument: warning
```

The rule can be disabled for a node and everything nested in it with an `# apigenie-lint-disable no-deprecated-required-argument` comment on the node, or for a whole file with the comment at the top of the file, separated from the first definition by a blank line. It applies to definitions.

## Examples

**Good**.

```graphql
type Query {
  users(limit: Int = 10 @deprecated(reason: "Use `first`.")): [User]
}
```

**Bad**. The linter reports `Required argument 'Query.users(limit:)' cannot be deprecated; make it optional or give it a default value first`.

```graphql
type Query {
  users(limit: Int! @deprecated(reason: "Use `first`.")): [User]
}
```
