07/20/2020, 9:05 AM
Please, is it possible to somehow "hide" any types when generating GraphQL schema? I am using Jetbrains Exposed library to ORM mapping, I have DAO object and entity class (having functions like
object TableObject : IdTable<Int>("tableName") {
    val property1 = long("column1")
    val property2 = long("column2")

class MappedEntity(id: EntityID<Int>): Entity<Int>(id){
    companion object : EntityClass<Int, MappedEntity>(TableObject)

    var entityProperty1 by TableObject.property1
    var entityProperty2 by TableObject.property2
I want to return
in GraphQL schema, but there is problem with
com.expediagroup.graphql.exceptions.TypeNotSupportedException: Cannot convert since it is not a valid GraphQL type or outside the supported packages
. Do I need to map this entity to another class, or is there way to use MappedEntity class in GraphQL schema?

Dariusz Kuc

07/20/2020, 1:24 PM
you can exclude types from being present in the schema by annotating them with
but that implies they have to be part of your code base
if they are outside your code base (as in your use case above) you can manually process them using schema generator hooks (but that might be somewhat tedious)
I think the simplest workaround is to map them to some data class within your code base
:yes: 1


07/24/2020, 12:20 PM
Don't share Entitiy & Graphql Model in the first place, would be an option.
👍 1