# graphql-kotlin

Jilles van Gurp

06/07/2021, 10:27 AM
I just ran into a
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.

Dariusz Kuc

06/07/2021, 2:17 PM
hello 👋 that might be a somewhat larger change -> i.e. that exception just says that specified
(in your case
) 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

Jilles van Gurp

06/07/2021, 3:32 PM 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