quarkus: GraphQL schema generation does not handle sealed classes

Describe the bug Sealed classes are ignored when generating the schema, causing issues with inner classes with same name.

Expected behavior

sealed class SealedClassA {
       data class Response(val propertyA: String)
}
sealed class SealedClassB {
       data class Response(val propertyB: String)
}

Generated schema:

type Response extends SealedClassA {
       propertyA: String
}
type ClassOne extends SealedClassB {
       propertyB: String
}

Actual behavior Generated schema:

type Response {
       propertyA: String
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 23 (14 by maintainers)

Most upvoted comments

Wow! It worked! Thanks a lot 💯

Oh I didn’t know that, ok. Note that this is only available since Quarkus 1.9.0

Try setting quarkus.smallrye-graphql.auto-name-strategy=MergeInnerClass

I managed to make it work in your demonstration. Thanks!

btw I think you might be the first person ever trying the GraphQL extension with Kotlin… This thing will definitely need some more care.

I’ll try and create something (I already did for a bit of experimenting), at least we’ll make sure we’re all on the same page