I just ran into a ` com.expediagroup.graphql.gener...
# graphql-kotlin
j
I just ran into a
com.expediagroup.graphql.generator.exceptions.TypeNotSupportedException
during schema generation where apparently one of my functions returns Unit which is not allowed. The problem is it does not tell me where the error is. Is there a way to get more detailed errors? Once I know where the error is, I can fix it. It would be helpful to improve this as this seems to happen a lot to me. In this case, complete mystery where the error is.
For the record, the issue was implementing an interface on a data class that we return is breaking the schema generation somehow. That seems to be a limitation currently. We had a simple interface that adds a few fields that the data classes override.
d
hello 👋 that might be a somewhat larger change -> i.e. that exception just says that specified
KType
(in your case
Unit
) is outside supported packages. When we forget to set packages for custom types it should be fairly easy to spot. But yeah looks like it might be pretty hard to find when referencing any of the Kotlin built-in types.
Looks like when building the types we don't store any info about where they are coming from (i.e. which field on which type).
Feel free to open up an issue to track this
j
https://github.com/ExpediaGroup/graphql-kotlin/issues/1177 BTW. the package was not the issue here. Both interface and data class were in the right package. The Unit one had me confused as it is clearly not the issue. The function was actually returning a data class. The only modification was me implementing an interface to that class with a few extra properties. That seems to confuse the reflection the generator uses somehow.
👍 3