# no-get-prefix-on-query-fields

Source: https://apigenie.pl/docs/linter/graphql/rules/no-get-prefix-on-query-fields

This rule checks that the fields of the query root type are not named `getSomething`.

## Rule Details

Query fields are nouns: the operation type already says that they read data. `user(id:)` is the convention, `getUser(id:)` comes from RPC APIs.

## Configuration

This rule has no options.

```yaml
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        no-get-prefix-on-query-fields: warning
```

The rule can be disabled for a node and everything nested in it with an `# apigenie-lint-disable no-get-prefix-on-query-fields` 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 { user(id: ID!): User }
```

**Bad**. The linter reports `Query field 'getUser' should not start with 'get', e.g. 'user'`.

```graphql
type Query { getUser(id: ID!): User }
```
