Перейти к содержимому

useInputName

Это содержимое пока не доступно на вашем языке.

biome.json
{
"linter": {
"rules": {
"nursery": {
"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/nursery/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.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

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": {
"nursery": {
"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": {
"nursery": {
"useInputName": {
"options": {
"checkInputType": "strict"
}
}
}
}
}
}
type Mutation {
SetMessage(input: InputMessage): String
}
type Mutation {
SetMessage(input: setMessageInput): String
}
type Mutation {
SetMessage(input: SetMessageInput): String
}