useInputName
Цей контент ще не доступний вашою мовою.
Summary
Section titled “Summary”- Rule available since:
v2.3.14 - Diagnostic Category:
lint/nursery/useInputName - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
- Same as
@graphql-eslint/input-name
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useInputName": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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}Options
Section titled “Options”checkInputType
Section titled “checkInputType”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"
{ "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}{ "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}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.