[naming-convention] Add Query-specific option
See original GitHub issueI think there could be a new option that targets the queries because the naming convention could be different from a field definition on a normal type.
For example, I may want to forbid the queries to have get
prefixes because queries are always “GET” but still allows other object type definitions, then I can add the following rule to eslint config:
"@graphql-eslint/naming-convention": [
"error",
{
"QueryFieldDefinition": { "format": "camelCase", "forbiddenPrefixes": ["get"] },
"FieldDefinition": { "format": "camelCase" },
}
]
type Query {
getUser: User # Error
user: User # OK
}
type User {
getter: User # OK
}
If it makes sense I can try creating a PR for this 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Learn SQL: Naming Conventions - SQLShack
A naming convention is a set of unwritten rules you should use if you want to increase the readability of the whole data...
Read more >Table field naming convention and SQL statements
For queries that aren't ad-hoc, you should always prefix every field with either the table name or table alias, even if the field...
Read more >Option naming convention - Wikipedia
In financial markets, an option naming convention is a method of identifying which of many possible options is being quoted or traded.
Read more >Define your naming convention - Cloud Adoption Framework
In this article. An effective naming convention consists of resource names from important information about each resource. A good name helps ...
Read more >Naming conventions | Cloud APIs
Rather, choose specific names that accurately describe the API concept. This is particularly important for names that define first-order API elements, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Available in
@graphql-eslint/eslint-plugin@0.8.0
@dotansimha I have created a PR for this: https://github.com/dotansimha/graphql-eslint/pull/256 Please have a look when you have a chance, thanks! 🙏