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

graphq-kotlin-client code generator with duplicated fields #2050

Closed
samuelAndalon opened this issue Oct 22, 2024 · 0 comments
Closed

graphq-kotlin-client code generator with duplicated fields #2050

samuelAndalon opened this issue Oct 22, 2024 · 0 comments
Assignees
Labels
module: client Issue affects the client code type: bug Something isn't working

Comments

@samuelAndalon
Copy link
Contributor

samuelAndalon commented Oct 22, 2024

Library Version
What version are you using?
latest.

Describe the bug

[Error] Conflicting declarations: public final val text: String, public final val text: String

Generated data classes contain duplicated fields when using unions

To Reproduce
Steps to reproduce the behavior. Please provide:

interface EGDSText {
    text: String!
}
type EGDSPlainText implements EGDSText {
    text: String!
}
union ProductRatingSupportingMessage = EGDSPlainText | ProductRatingLink

union ProductSupportingMessage = EGDSGraphicText | EGDSInlineLink | EGDSParagraph | EGDSPlainText | EGDSStandardBadge | LoyaltyDialogWithTrigger | EGDSLoyaltyBadge

Both ProductRatingSupportingMessage and ProductSupportingMessage share the EGDSPlainText type. However, when generating the Kotlin classes, I get something like this:

@Generated
public data class EGDSPlainText(
  public val text: String,
  public val text: String,
) : ProductRatingSupportingMessage, ProductSupportingMessage

Expected behavior
data classes with unique fields.

@samuelAndalon samuelAndalon added type: bug Something isn't working module: client Issue affects the client code labels Oct 22, 2024
@samuelAndalon samuelAndalon self-assigned this Oct 24, 2024
samuelAndalon added a commit that referenced this issue Oct 27, 2024
… constructors from interfaces (#2051)

### 🔗 Related Issues
#2050

---------

Co-authored-by: Samuel Vazquez <samvazquez@expediagroup.com>
samuelAndalon added a commit that referenced this issue Oct 28, 2024
… constructors from interfaces (#2051)

### 🔗 Related Issues
#2050

---------

Co-authored-by: Samuel Vazquez <samvazquez@expediagroup.com>
samuelAndalon added a commit that referenced this issue Oct 28, 2024
… constructors from interfaces (#2051) (#2052)

### 🔗 Related Issues
#2050

---------

Co-authored-by: Samuel Vazquez <samvazquez@expediagroup.com>
samuelAndalon added a commit that referenced this issue Oct 28, 2024
… constructors from interfaces (#2051) (#2052)

### 🔗 Related Issues
#2050

---------

Co-authored-by: Samuel Vazquez <samvazquez@expediagroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: client Issue affects the client code type: bug Something isn't working
Development

No branches or pull requests

1 participant