Description
Is your feature request related to a problem? Please describe.
Currently, the OperationDefinition
naming convention rule in @graphql-eslint
can only be configured globally for all operation types. This limitation makes it difficult to enforce different naming conventions for different types of operations (query, mutation, subscription), which is a common requirement in many codebases.
Describe the solution you'd like
I would like to be able to configure OperationDefinition naming conventions per operationType.
To support this, I propose the following changes:
-
Allow OperationDefinition to accept an array of asObject configurations. (
asArray<asObject>
) -
Add an operationType property to each asObject to specify which operation type it applies to.
This would allow configurations like the following:
{
"OperationDefinition": [
{ "style": "PascalCase", "operationType": "query" },
{ "style": "snake_case", "operationType": "mutation" },
{ "style": "camelCase", "operationType": "subscription" }
]
}
Describe alternatives you've considered
Additional context