ExpediaGroup / graphql-kotlin

Libraries for running GraphQL in Kotlin
https://opensource.expediagroup.com/graphql-kotlin/
Apache License 2.0
1.74k stars 351 forks source link

Input suffix removed from input type. #2031

Closed Samjin closed 3 weeks ago

Samjin commented 3 months ago

Library Version Any latest version of 6, 7 and upcoming 8.

Describe the bug https://github.com/ExpediaGroup/graphql-kotlin/pull/1960

This PR introduces breaking changes for many services, particularly those that use shared type libraries. While a manual fix involving the addition of an Input suffix to a Kotlin class could be a solution, it is important to recognize that this would necessitate updating classes across all services within a large organization, which is not practical.

To Reproduce

@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT])
data class UriContext(){}
  1. The above code compiles to UriContextInput graphql type, but now it becomes UriContext.
  2. Another potential problem could arise if there is already a UriContext type.
  3. Subgraph schema generates UriContext after graphql-kotlin updates, but shared type lib with older version of graphql-kotlin could still create UriContextInput.

Expected behavior

Ideally revert the PR. If not possible, can we make it configurable?

samuelAndalon commented 3 months ago

https://github.com/ExpediaGroup/graphql-kotlin/pull/2032