- Category:
Schema
- Rule name:
@graphql-eslint/input-name
- Requires GraphQL Schema:
false
ℹ️ - Requires GraphQL Operations:
false
ℹ️
Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". Using the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to.
# eslint @graphql-eslint/input-name: ['error', { checkInputType: true }]
type Mutation {
SetMessage(message: InputMessage): String
}
# eslint @graphql-eslint/input-name: ['error', { checkInputType: true }]
type Mutation {
SetMessage(input: SetMessageInput): String
}
# eslint @graphql-eslint/input-name: ['error', { checkInputType: false }]
type Mutation {
SetMessage(input: AnyInputTypeName): String
}
The schema defines the following properties:
Check that the input type name follows the convention Input
Default: false
Allow for case discrepancies in the input type name
Default: true
Apply the rule to Queries
Default: false
Apply the rule to Mutations
Default: true