COVESA / COVESA/s2dm

Plural field name handling

Open
#164 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
17
Forks
10
Avg merge
1d 10h
Merged PRs (30d)
2

Description

Right now, the `check` command can check for `--naming-config`. The naming config let the user configure the desire naming case for each element group in the GraphQL SDL language. However, internally, the naming config logic also uses the [inflect library](https://github.com/jaraco/inflect) to check that the names of the fields that have List modifiers are plural, which is a best practice. For example:

```graphql
type Car {
window: [Window] # This is wrong! as the field name should be "windows"
}

type Window {
isOpen; Boolean
}
```

Whenever the --naming-config validation is called, the plural name check is executed silently.

Action points:

- [ ] Plural name check for fields that use List type modifiers must be explicitly given in the config file. e.g., via a flag `plural_list_field_names: True`
- [ ] Enhance the behavior of the plural check to handle variations like "window_s", etc.

Contributor guide

Open the contributing guide

Research direction

Start at the `check` command's `--naming-config` validation and trace how the naming config invokes the `inflect` library for List fields. Define the configuration behavior for enabling plural checks, then examine how variants such as `window_s` should be handled. Done means the check is no longer silently enabled and the requested plural-name cases behave as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.