Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ability to specify @GraphQLName on input types w/o suffix #1960

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

Currently input types are always suffixed with Input which is problematic as there are use cases where users might want to provide different custom name. This change adds check whether specified type is input only and if thats the case it does not attempt to add Input suffix.

🔗 Related Issues

Supersedes #1949

Currently input types are always suffixed with `Input` which is problematic as there are use cases where users might want to provide different custom name. This change adds check whether specified type is input only and if thats the case it does not attempt to add `Input` suffix.

```kotlin
// old: MyClassInput
// new: MyClass
@GraphQLValidObjectLocations([GraphQLValidObjectLocations.Locations.INPUT_OBJECT])
class MyClass

// can also be combined with renaming
// old: MyRenamedClassInput
// new: MyRenamedClass
@GraphQLValidObjectLocations([GraphQLValidObjectLocations.Locations.INPUT_OBJECT])
@GraphQLName("MyRenamedClass")
class MyClass
```
@dariuszkuc dariuszkuc changed the title BREAKING: ability to specify @GraphQLName on input types w/o suffix fix: ability to specify @GraphQLName on input types w/o suffix Apr 17, 2024
@dariuszkuc dariuszkuc added changes: patch Changes require a patch version changes: minor Changes require a minor version and removed changes: major Changes require a major version changes: patch Changes require a patch version labels Apr 17, 2024
@dariuszkuc dariuszkuc changed the title fix: ability to specify @GraphQLName on input types w/o suffix feat: ability to specify @GraphQLName on input types w/o suffix Apr 17, 2024
@dariuszkuc
Copy link
Collaborator Author

dariuszkuc commented Apr 17, 2024

While technically it is possible that folks used valid location = input + custom name so it could be considered breaking change, this seems rather unlikely case (as they would need to explicitly specify Input suffix OR rely on auto suffix) so keeping it as a feature/minor.

@dariuszkuc dariuszkuc enabled auto-merge (squash) April 17, 2024 04:12
@agarwalaman786
Copy link

I am having one question on this.

clarify that `Input` suffix is only appended IF it already doesn't end with that suffix
@dariuszkuc dariuszkuc merged commit 862460e into ExpediaGroup:master Apr 17, 2024
9 checks passed
@dariuszkuc dariuszkuc deleted the graphql_input_name branch April 17, 2024 20:26
samuelAndalon pushed a commit that referenced this pull request Apr 18, 2024
)

### 📝 Description

Currently input types are always suffixed with `Input` which is
problematic as there are use cases where users might want to provide
different custom name. This change adds check whether specified type is
input only and if thats the case it does not attempt to add `Input`
suffix.

### 🔗 Related Issues
Supersedes #1949
samuelAndalon pushed a commit that referenced this pull request Apr 18, 2024
)

### 📝 Description

Currently input types are always suffixed with `Input` which is
problematic as there are use cases where users might want to provide
different custom name. This change adds check whether specified type is
input only and if thats the case it does not attempt to add `Input`
suffix.

### 🔗 Related Issues
Supersedes #1949
samuelAndalon added a commit that referenced this pull request Apr 18, 2024
) (#1962)

Co-authored-by: Dariusz Kuc <9501705+dariuszkuc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: minor Changes require a minor version
Development

Successfully merging this pull request may close these issues.

3 participants