As an example: ```schema.objectType({ name: 'Ite...
# orm-help
s
As an example:
Copy code
schema.objectType({
  name: 'Item',
  definition(t) {
    t.model.id()
    t.model.name()
    t.model('ItemInstance').data()
  }
})
Unfortunately the explicit selection of
ItemInstance
doesn't work in this case, as model is not a function as soon as the
name
of the
objectType
matches a Prisma type.
r
Hey @Sascha 👋 Do you have a model named
ItemInstance
? If so, then it should work properly.
Copy code
schema.objectType({
  name: 'ItemInstance',
  definition(t) {
    t.model.data()
  }
})
This should be defined in Nexus
Also could you share the link to the docs where this is mentioned 🙂
s
Cheers @Ryan ! The problem is that I need types from two of my internal/prisma ones, as the external one is a superset of those two internal types. So I need to inherit types from Item and ItemInstance, on an my external/nexus type called Item.
But I just figured I could just rename my internal Item to ItemPrototype.
Then .model becomes a function/callable again, as I don't have an internal type matching the external one.