Skip to content

Conversation

@danadajian
Copy link
Collaborator

@danadajian danadajian commented Apr 22, 2024

📝 Description

  • GraphQL Kotlin allows for 2 ways of representing union types in Kotlin: marker interfaces and annotation classes. Marker interfaces (i.e. empty Kotlin interfaces) should be the default way we generate Kotlin code from GraphQL union types. This way, we enforce that resolvers implement one of a few classes that inherit from the interface, rather than enforcing the use of Any!
  • This is a breaking change which will make the default behavior to generate marker interfaces from union types, but leave the option to generate annotation classes (via unionGeneration: ANNOTATION_CLASS).
  • This change also injects some defaults into the parsed config object and refactors a bunch of code for repo maintainability.

@danadajian danadajian force-pushed the support-marker-interfaces branch from 0bd1a6c to 079e2bc Compare April 22, 2024 18:03
@danadajian danadajian marked this pull request as ready for review April 22, 2024 18:21
@danadajian danadajian requested a review from a team as a code owner April 22, 2024 18:21
@danadajian danadajian force-pushed the support-marker-interfaces branch from b4af965 to af367f1 Compare April 22, 2024 18:40
@danadajian danadajian force-pushed the support-marker-interfaces branch 9 times, most recently from 8ed2c5c to fddd3df Compare April 24, 2024 01:20
@danadajian danadajian force-pushed the support-marker-interfaces branch from fddd3df to ecbaed3 Compare April 24, 2024 01:22
@danadajian danadajian merged commit cee01d4 into main Apr 24, 2024
@danadajian danadajian deleted the support-marker-interfaces branch April 24, 2024 01:25
danadajian added a commit that referenced this pull request Apr 24, 2024
BREAKING CHANGE: generate marker interfaces for union types by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants