# no-type-suffix

Source: https://api-genie.dev/docs/linter/graphql/rules/no-type-suffix

A rule of the GraphQL linter, which reads GraphQL schemas and operations. Since 0.9.0. In the rulesets: Strict at error, All at error.

This rule checks that type names don't end with a redundant suffix such as `Type` or `Enum`.

## Rule details

The kind of a type is already part of its definition and of introspection; `UserType` or `KindEnum` only make names longer. By default the suffixes are `Type`, `Object`, `Interface`, `Union`, `Enum`, `Scalar` and `Input`; `Input` is allowed on input object types (see `input-type-suffix`).

The rule applies to definitions. An `# apigenie-lint-disable no-type-suffix` comment on a node turns
it off for the node and everything nested in it; at the top of the file, separated from the first
definition by a blank line, the comment turns it off for the whole file.

## Configuration

The configuration block is an object with the `suffixes` property, the list of suffixes
that are reported.

```yaml
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        no-type-suffix: [error, { suffixes: [Type, Model] }]
```

## Examples

**Good**.

```graphql
type User { id: ID! }
enum Kind { CAT }
```

**Bad**. The linter reports `Object type 'UserType' should not end with 'Type'`.

```graphql
type UserType { id: ID! }
```
