# mutation-payload-suffix

Source: https://apigenie.pl/docs/linter/graphql/rules/mutation-payload-suffix

This rule checks that the result types of mutation fields end with a suffix, `Payload` by default.

## Rule Details

Payload types are specific to their mutation; the suffix tells them from the domain types they contain. Scalar and enum results are not reported (see `no-scalar-result-on-mutation`).

## Configuration

The configuration block can be a string, the suffix, or an object with the `suffix`
property.

```yaml
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        mutation-payload-suffix: [error, Result]
```

The rule can be disabled for a node and everything nested in it with an `# apigenie-lint-disable mutation-payload-suffix` 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 Mutation { createUser(input: CreateUserInput!): CreateUserPayload }
```

**Bad**. The linter reports `The result type 'User' of field 'Mutation.createUser' should end with 'Payload'`.

```graphql
type Mutation { createUser(input: CreateUserInput!): User }
```
