Skip to content

useInputName

biome.json
{
"linter": {
"rules": {
"style": {
"useInputName": "error"
}
}
}
}

Require mutation argument to be always called “input”

Using the same name for all input parameters will make your schemas easier to consume and more predictable.

type Mutation {
SetMessage(message: InputMessage): String
}
code-block.graphql:2:14 lint/style/useInputName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected input name, expected the input name “message” to be named “input”.

1 │ type Mutation {
> 2 │ SetMessage(message: InputMessage): String
^^^^^^^^^^^^^^^^^^^^^
3 │ }
4 │

Using the same name for all input parameters will make your schemas easier to consume and more predictable.

type Mutation {
SetMessage(input: SetMessageInput): String
}

With the option checkInputType on, the input type name requires to be called <mutation name>Input. This can either be “loose” (case-insensitive) or “strict” (case-sensitive). Using the name of the mutation in the input type name will make it easier to find the mutation that the input type belongs to.

Default "off"

biome.json
{
"linter": {
"rules": {
"style": {
"useInputName": {
"options": {
"checkInputType": "loose"
}
}
}
}
}
}
type Mutation {
SetMessage(input: InputMessage): String
}
type Mutation {
SetMessage(input: setMessageInput): String
}
type Mutation {
SetMessage(input: SetMessageInput): String
}
biome.json
{
"linter": {
"rules": {
"style": {
"useInputName": {
"options": {
"checkInputType": "strict"
}
}
}
}
}
}
type Mutation {
SetMessage(input: InputMessage): String
}
type Mutation {
SetMessage(input: setMessageInput): String
}
type Mutation {
SetMessage(input: SetMessageInput): String
}